Saturday, March 24, 2012

PageRequestManagerServerException

I have a callback funtion but I get the following error when I use this when the login credential has expired:

Sys.WebForms.PageRequestManagerServerException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

I.e It tries to get information from a function that is not reachable as the user has been loged out.

If the page is reloaded i will get rerouted to the login page but as i don't reload the page and only using a callback i don't get rerouted - i only get the above error message.

Any Ideas?

You can capture the error on the client side and redirect the user there using the Javascript window.location

Seehttp://www.asp.net/AJAX/Documentation/Live/tutorials/CustomizingErrorHandlingforUpdatePanel.aspx for handling errrors from the UpdatePanel; if you are using PageMethods seehttp://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx for capturing errors.

-Damien


Try to capture asynchronous post back error as the follow.


ScriptManager.AsyncPostBackError += new EventHandler<AsyncPostBackErrorEventArgs>(ScriptManager_AsyncPostBackError);


Determine if it is asynchronous post back : ScriptManager.IsInAsyncPostBack;

Get synchronous post back error message: ScriptManager.AsyncPostBackErrorMessage;


Get asynchronous post back source: ScriptManager.AsyncPostBackSourceElementID;

Let me know if this helpful to you

No comments:

Post a Comment