This is a migrated thread and some comments may be shown as answers.

Javascript error PageRequestManagerServerErrorException on Response.Redirect

4 Answers 118 Views
Ajax
This is a migrated thread and some comments may be shown as answers.
Kevin Kess
Top achievements
Rank 1
Kevin Kess asked on 14 May 2010, 06:47 PM
I currently have a webpage that Inherits from a basePage class. Within the basePage class, I have some code to register an event handler for all unhandled errors on the web page, as seen below :

  protected override void OnInit(EventArgs e){
      // Trap any unhandled exceptions and log them.
      Error += BasePage_Error;
      base.OnInit(e);
    }

  private void BasePage_Error(object sender, EventArgs e){
      Exception ex = Server.GetLastError();
      int errorID = LogException(ex);
      Server.ClearError();
      Response.Redirect(Page.ResolveUrl(string.Format("~/Error.aspx?ReferenceNumber={0}", errorID)));
    }


The problem comes in after I add in an RadAjax panel to the main page and surround my current form with the AjaxPanel. If some unhandled error ends up going to BasePage_Error routine, when it goes to the Response.Redirect line I get the following javascript error on the browser:

Line: 4723
Error: Sys.WebForms.PageRequestManagerServerErrorException: Input string was not in a correct format.

The Response.Redirect command is somehow causing issues, but only when I have the AjaxPanel on the page. If I remove the panel, and run into the same issue, the Response.Redirect line works perfectly. Does anyone have an idea on what I can be doing wrong, or how to fix this issue?

4 Answers, 1 is accepted

Sort by
0
Daniel
Telerik team
answered on 15 May 2010, 09:49 AM
Hello Kevin,

Please examine the following topic:
Redirecting to another page

Best regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kevin Kess
Top achievements
Rank 1
answered on 18 May 2010, 02:41 PM
This hasn't fixed my issue yet. I will include a more detailed example soon...
Kevin
0
Daniel
Telerik team
answered on 21 May 2010, 01:47 PM
Hello Kevin,

Can you reproduce this error using standard ASP.NET UpdatePanel or it happens with our controls only? If this is not the case, could you please attach a sample project so we can debug your application locally?

Regards,
Daniel
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Kevin Kess
Top achievements
Rank 1
answered on 26 May 2010, 08:43 PM
I was able to resolve this issue, by registering for the onAsyncPostBackError event on the scriptmanager and capturing and redirecting from that routine.


Kevin
Tags
Ajax
Asked by
Kevin Kess
Top achievements
Rank 1
Answers by
Daniel
Telerik team
Kevin Kess
Top achievements
Rank 1
Share this question
or