Monday, March 26, 2012

Callback after UpdatePanel

Is there a way to use a callback function in JavaScript after UpdatePanel complete

just like you can do when using a web service or PageMethods?

As so far, you?can?not?use?a?callback?after?asp:Update?is?updated?completely.Maybe?this?could?be?implemented?in?the?near?future.But?
you?can?define?a?LoadCompleted?event?in?a?custom?UpdatePanel?and?then?call?a?callback?after?it?updated?completely.?
If you would like to use callback,web service or PageMethods is better selection.
Wish this could give you some ideas.
yes but the only problem is that in web service or PageMethods (static) you don't have access to the controls on the page.

I found a solution to my problem.

and it is very simple also:

<script type="text/javascript" language="javascript">
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_pageLoaded(PageLoadedEventHandler);
function PageLoadedEventHandler() {
// custom script
}
</script>

No comments:

Post a Comment