Sys.WebForms.PageRequestManager.getInstance().add_endRequest not working
-
I have an aspx page with jscript in a separate .js file. The page has an autocomplete extender, and I am trying to debug a problem by putting an alert in my EndRequestHandler function. For some reason, it's not executing either the EndRequestHandler or the InitializeRequest functions. It executes OnPageLoad without error, as well as another jscript function hooked to a button click event further south. What am I doing wrong? Thanks for any clues for the clueless.
function OnPageLoad()
{
// OnPageLoad() is defined in _smfcommon.js, which is included in all pages.
// We override it here so we can use the EndRequestHandler and InitializeRequest functions
// in this page.// Add initializeRequest and endRequest Sys.WebForms.PageRequestManager.getInstance().add\_initializeRequest(InitializeRequest); Sys.WebForms.PageRequestManager.getInstance().add\_endRequest(EndRequestHandler); return;
}
// Called when async postback begins
function InitializeRequest(sender, args) {
alert("You are in the InitializeRequestHandler function."); // breakpoint here
}// Called when async postback ends
function EndRequestHandler(sender, args)
{
// this function is run after an Ajax partial postback occursalert("You are in the EndRequestHandler function."); // breakpoint here
if (args.get_error() != undefined)
alert("There was an error" + args.get_error().message);return;
}
My other signature is witty and insightful.