Exception Handling in Global.asax, Application_Error

Some of the Limitations of Exception Handling in Global.asax (Application_Error)

  • An error handler that is defined in the Global.asax file will only catch errors that occur during processing of requests by the ASP.NET runtime. For example, it will catch the error if a user requests an .aspx file that does not occur in your application. However, it does not catch the error if a user requests a nonexistent .htm file. For non-ASP.NET errors, you can create a custom handler in Internet Information Services (IIS). The custom handler will also not be called for server-level errors. 
  • You cannot directly output error information for requests from the Global.asax file; you must transfer control to another page, typically a Web Forms page. When transferring control to another page, use Transfer method. This preserves the current context so that you can get error information from the GetLastError method.
  •  Application_Error never fires for a web service.
  • Application_Error will catch parser, compilation, and run-time errors within pages. It will not catch configuration issues, nor will it catch errors that occur within inetinfo while aspnet_isapi processes the request.

One of the biggest advantages of Exception Handling in Global.asax (Application_Error)
  •     Good in Performance

No comments:

Post a Comment

Keep ur coding aside.. Relax for some time..