Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Wednesday, March 28, 2012

why page load is called when an updatepanel is updated

Hi,

i have just observed that when a request is posted to server inside an updatepanel. then load method of page is called.

create a page with script manager and updatepanel. put a button inside the panel. add a msgbox in the load eventhandler of page.

now when u will click the button page load eventhandler would be executed. i was expecting that only the load event of update panel would be executed not the page one. because what ajax says is that whole page is not reloaded only the updatepanel is reloaded. does it mean that the ajax only helps to not activate the back button on browser but underlying it reloads the page in fact.

thanks

Hi i think you misunderstood something. what AJAX meant for is not exactly for asynchronous postbacks. This means that you cant execute two threads parallelly. But what it does is partial rendering. During an async postback all the usual events will be executed but only the contents inside the Update panel will be rendered.


hello.

well, what they're trying to say is that only the updatepanel contents will be updated during a partial postback. you can use the scriptmanager isinasyncpostback property to see if you're in a partial postback scenario:

http://asp.net/AJAX/Documentation/Live/mref/P_System_Web_UI_ScriptManager_IsInAsyncPostBack.aspx


rex_alias:

Hi i think you misunderstood something. what AJAX meant for is not exactly for asynchronous postbacks. This means that you cant execute two threads parallelly. But what it does is partial rendering. During an async postback all the usual events will be executed but only the contents inside the Update panel will be rendered.

I'm pretty sure that's exactly what AJAX is meant for.

And you can execute two threads parallelly.

Partial rendering isn't related to AJAX, you can have partial rendering without AJAX, and you can have AJAX without partial rendering, although it's implemented in the UpdatePanel and its implementation uses AJAX.

And yes, the whole life cycle of the page happens on the server, but only the relevant portions of the output are rendered into a xml based diff-gram, and sent to the client.


This is the nature of Update Panel. You can filter out the Regular Post Back with an Async by Checking the Page ScriptManager.IsInAsyncPostBack. Or if you do not want to page to be called then use the Client Centric Development Model which is calling the Web Service or Static Page Methods.

Monday, March 26, 2012

Win2k Server problem ... Could not load Assembly "App_Web_xxx"

Is anybody else having problems deploying an AJAX enabled web site to Win2K Server? I am developing on XP and everything is working fine, but when I deploy to my production server none of the .aspx pages work. They all produce messages similar to:

Parser Error

Description:An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

Parser Error Message:Could not load the assembly 'App_Web_nh6rut9z'. Make sure that it is compiled before accessing the page.

Source Error:

Line 1: <%@dotnet.itags.org. page language="c#" inherits="TrailerParkC.TelemetryMain, App_Web_nh6rut9z" %>Line 2: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >Line 3: <HTML>

I have read though many of the posts here and nothing seems to fix this. BTW, I do have the Microsoft.Web.Preview.dll in my /bin directory, but that doesn't help. Seems as though something is not being registered/generated correctly during the compile process?

Any help would be greatly appreciated.

Thanks.

Hi,

i had the same problem, you need to create an web site application in your iis.

To do this goto start->settings->control panel->Administrative tools->Internet services manager ->open properties on your web site folder-> under "Directory" tab, click the Create button under "Application name" textbox.

hope that helps.

toma.

Saturday, March 24, 2012

Wizard+updatepanel+usercontrols

I've got a problem using updatepanels inside the wizard.

Each of the wizard steps is a user control in my case, so I load the user controls into the steps. If two of my usercontrols contain updatepanels then I get "Microsoft JScript runtime error: Object required"

somewhere in the Atlas JavaScript code when using the Atlas functionality in the steps:

function destroyTree(element, markupContext) {

if (element.nodeType == 1) { //error on this line

if (element.control) {

markupContext.removeObject(element.control);

element.control.dispose();

}

var children = element.children;

for (var i = children.length - 1; i >= 0; i--) {

var node = children[i];

destroyTree(node, markupContext);

element.removeChild(node);

}

}

}

I've tried moving the scriptmanager wherever it is possible: in the page containing the wizard, in the user controls. It won't happen if I have only one usercontrol/wizard step using updatepanels. So if anyone encountered similar problems or have ideas how to make it work-reply.

have you tried setting Mode="Conditional" on all of your updatepanels?

http://forums.asp.net/thread/1268686.aspx

Thanks, that worked!

I've tried setting the mode to conditional on all updatepanels for sure, but probably missed one updatepanel that was set to always or something like that.Smile [:)]