Custom Error Pages method of exception handling - ASP.NET

Define Error Events.

ASP.NET supports events that occur when any unhandled exception occurs in an application. These events are called as Error Events.

ASP.NET provides two such events to handle exceptions:

Page_Error : This is page event and is raised when any unhandled exception occur in the page.

Application_Error: This is application event and is raised for all unhandled exceptions in the ASP.NET application and is implemented in global.asax

The Error events have two methods to handle the exception:

GetLastError: Returns the last exception that occurred on the server.

ClearError: This method clear error and thus stop the error to trigger subsequent error event.
Why is exception handling important to an application?
ASP.NET - Why is exception handling important to an application? - Exception handling is used to prevent application from being stuck due to unusual occurrences...
When can you use tracing with exception handling?
ASP.NET - When can you use tracing with exception handling? - You can use tracing with exception handling to log unanticipated exception to the trace log......
What is Master Page in ASP.NET?
ASP.NET - What is Master Page in ASP.NET? - A Master page offers a template for one or more web forms...
Post your comment