Thursday, February 7, 2008

Error/Exception Sequence in a Page

Error/Exception Sequence

When an unhandled exception is thrown from any click handler at page level (As below), below is the sequence it follows for the propogatation.

protected void Button1_Click(object sender, EventArgs e)


throw new Exception("Arun");


· Page_Error Event Handler - Remove further propgation by Server.ClearError()

· ErrorPage attribute at the Page Level

· Application_Error in Global.asax - Remove further propgation by Server.ClearError()

· Custom Errors in Web.config (If Any) – And if the page is not found at this last level it handles the error to the OS.

Thanks & Regards,

Arun Manglick || Tech Lead

No comments:

Post a Comment