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?
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?