This all works as expected, I'm picking up the error via the PageRequestManager EndRequest and displaying on the page
The problem is that I'm getting an Application_Error in my Global.asax stating that an Exception of type 'System.Web.HttpUnhandledException' was thrown.
I kinda get it I think, cause I'm throwing the exception which is not caught by a catch I'm assuming?!
Any advice on what I'm missing, or where in fact I'm going wrong?
Your javascript code... But it is needed to know why this is throwing an exption. It is difficult to say why the exception is occuring without having a look at it.
ian_c22
Member
30 Points
16 Posts
AsyncPostBackError - throw exception from Content Page to Mater Page
Feb 15, 2012 01:22 PM|LINK
Wonder if anyone can help. I'm trying to implement the ToolScriptManager OnAsyncPostBackError.
The ToolkitScriptManager is on the Masterpage and I've set the OnAsyncPostBackError property:
<ajax:ToolkitScriptManager ID="ToolkitScriptManager" runat="server" EnablePartialRendering="true" OnAsyncPostBackError="ScriptManager_AsyncPostBackError"> </ajax:ToolkitScriptManager>On my content page I'm catching an exception and, logging it and then throwing it
catch (Exception ex) { ... logError(ex) } private void LogError(Exception ex, bool full) { ... _presenter.LogError(this, error, ex); throw ex; }where it then gets picked up by the handler on the Master Page
protected void ScriptManager_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e) { ToolkitScriptManager.AsyncPostBackErrorMessage = e.Exception.Message; }This all works as expected, I'm picking up the error via the PageRequestManager EndRequest and displaying on the page
The problem is that I'm getting an Application_Error in my Global.asax stating that an Exception of type 'System.Web.HttpUnhandledException' was thrown.
I kinda get it I think, cause I'm throwing the exception which is not caught by a catch I'm assuming?!
Any advice on what I'm missing, or where in fact I'm going wrong?
Thanks in advance!
Ian
HttpUnhandledException asyncpostbackerror
sushanth009
Contributor
6243 Points
1168 Posts
Re: AsyncPostBackError - throw exception from Content Page to Mater Page
Feb 15, 2012 05:14 PM|LINK
Paste the code that is under the script tag.. It would help..
HttpUnhandledException asyncpostbackerror
ian_c22
Member
30 Points
16 Posts
Re: AsyncPostBackError - throw exception from Content Page to Mater Page
Feb 15, 2012 07:24 PM|LINK
Hi, sorry which code are you after? If it makes it clearer the Unhandled Exception occurs where I'm throwing ex from the LogError method.
Thanks for the reply btw.
</div>sushanth009
Contributor
6243 Points
1168 Posts
Re: AsyncPostBackError - throw exception from Content Page to Mater Page
Feb 15, 2012 07:53 PM|LINK
Your javascript code... But it is needed to know why this is throwing an exption. It is difficult to say why the exception is occuring without having a look at it.