ChiBella
asked on
Response.write exception in try catch statement
Trying to learn how to do exception handling in .net c#. I wanted to just raise an error to the page but get the error below when I try this statement. Can anyone tell me why? How can I simply display the error (preferrably in a message box) on a web form?
catch (Exception ex)
{
Response.Write(ex.Message) ;
}
Microsoft JScript runtime error: Sys.WebForms.PageRequestMa nagerParse rErrorExce ption: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.
catch (Exception ex)
{
Response.Write(ex.Message)
}
Microsoft JScript runtime error: Sys.WebForms.PageRequestMa
ASKER
Yes...and I also cannot update a label which is outside of the updatepanel.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx