Do you know that? 79% of Upwork-Elance freelancers work from home next

Define Error Events.

ASP.NET supports events that occur when any unhandled exception occurs inan 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 triggersubsequent error event.