I put the following javascript code inline but it doesn't trigger after the updatepanel is done with its postback:
function EndRequestHandler(sender, args) { alert("this should work"); }
开发者_Python百科Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
Any ideas?
Thanks.
ok, nevermind, I got it. If someone else runs into this problem, put the sys.webforms..... line like this:
$(document).ready( function () { sys.webforms....; }
Do following thing place following function on dom load.
function load() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
}
This may be help you.
var prm = Sys.WebForms.PageRequestManager.getInstance();
if (prm != null) {
prm.add_endRequest(function (sender, e) {
if (sender._postBackSettings.panelsToUpdate != null) {
DisplayCurrentTime(); // here your javascript function
}
});
};
Just to clear up the confusion here is the full code
function EndRequestHandler(sender, args)
{ yourFunction(); }
jQuery(document).ready(function (){
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(EndRequestHandler);
});
Hope this helps!
精彩评论