I've always used the following two bits of code (which use to work) to catch Ajax asyncPostBackErrors.
<asp:ScriptManager ID="ScriptManager1" runat="server" OnAsyncPostBackError="ScriptManager1_AsyncPostBackError" />
and
protected void ScriptManager1_AsyncPostBackError(object sender, AsyncPostBackErrorEventArgs e)
{
ScriptManager1.AsyncPostBackErrorMessage = e.Exception.Message;
}
But now even tho the unhandled exception is been caught in this event handler function and the AsyncPostBackErrorMessage been set with the Exception message, I'm always get same Error reporting in the page in a alert box no matter what the exception message was, saying :
Error: Sys.WebForms.PageRequestManagerParserErrorException: The message recieved from the server could not be parsed. Common causes for this error are when the response is modified by calls to the Respnse.Write() ....
The error is the same error you would get if you had an unhandled asyncPostBack exception and you didn't wire up the Scriptmanger's asyncPostBackError event handler method.
No matter what I do I get the same error does anyone have any idea what would be causing this?
Cheers
Cliff