Sys.WebForms.PageRequestManagerServerErrorException in FireFox with MSFT Ajax

If you encounter this error while navigating away from an AJAX-enabled page with a non-IE browser, you can silence it with the following JavaScript:

 
if (!document.all) //non-ie
{
window.onbeforeunload = function() {
Sys.WebForms.PageRequestManager.getInstance().add_endRequest(ignoreOnEndRequest);
}
}
 
function ignoreOnEndRequest(sender, e) {
err = e.get_error();
if (err) {
if (err.name == "Sys.WebForms.PageRequestManagerServerErrorException") {
e.set_errorHandled(true);
}
}
}

Hope it works for you!


This entry was posted in ASP.Net, C#, FireFox, JavaScript. Bookmark the permalink.

One Response to Sys.WebForms.PageRequestManagerServerErrorException in FireFox with MSFT Ajax

  1. Dmitri says:

    Thanks a lot for your solution it saved me a lot of time for my project. Regards

Leave a Reply

Your email address will not be published. Required fields are marked *