You can use the PageLoaded event on the PageRequestManager class. Here's an example.
http://ajax.asp.net/docs/ViewSample.aspx?sref=Sys.WebForms.PageRequestManager.pageLoaded
You'll just need to create a JS function that handles the event and put the code that you need run in there.
HTH,
Rick
Hi Olav.Net and thecodedude,
Olav.NET.Ajax:
I have some JavaScript code that I use for fianal adjustments of my pages.
Generally want it to run as late as possible.
Based on ASP.NET AJAX Client Life-Cycle Events, endRequest Event is the last event for an asynchronous postback and padLoaded event is the last event for a synchronous postback(It is also fired in a asynchronous ). .
pageLoaded Event
Raised after all content on the page is refreshed, as a result of either a synchronous or an asynchronous postback. For synchronous postbacks, panels can only be created, but for asynchronous postbacks, panels can be both created and updated. You can use this event to manage a custom transition effect for updated content.
The pageLoaded event takes aneventargs parameter, which is anSys.WebForms.PageLoadedEventArgs object. This object makes available information about which panels were updated and created in the most recent postback.
endRequest Event
Raised after the response for an asynchronous postback is processed and the page is updated, or during the processing of the response if there is an error. If an error occurs, the page is not updated. Use this event to provide customized error notification to users or to log errors.
The endRequest event takes aneventargs parameter, which is aSys.WebForms.EndRequestEventArgs object. This object makes available information about errors that have occurred and whether the error was handled. It also makes available the response object.
Here is the useful url: http://ajax.asp.net/docs/overview/AJAXClientEvents.aspx
By the way , you can also use setTimeout().
Hope it helps.
0 件のコメント:
コメントを投稿