asp.net Error pocessing method

Source: Internet
Author: User
Asp.net|error errors are grouped into four categories: configuration errors, parse errors, compilation errors, and Run-time errors.
By default, the information displayed for Run-time errors is the call stack (the chain of procedure calls that cause the exception). If debug mode is enabled, ASP.net displays the line number in the source code where a run-time error occurred.
asp.net enables you to specify whether to display an error to a local client, a remote client, or both. By default, errors are displayed only to local clients (that is, clients on the same computer on which the server resides). You can also specify a custom error page to redirect the client to the page in the event of an error.
In addition to redirecting all errors to a common page, you can assign specific error pages to specific error status codes. The <customerrors> configuration section supports the internal <error> tag, which associates the HTTP status code with the custom error page.
You can handle code errors at the page level or at the application level. The page base class exposes a HandleError method that can be overridden in a page. This method is called whenever the runtime throws an exception that is not caught.
System.Web.Mail namespaces expose classes that programmatically send e-mail messages. This is useful for notifying administrators when an error occurs.
In addition to processing errors at the page level, you can use the Application_Error event in Global.asax to handle application-level errors. This event is raised for any unhandled exception that is raised in the application.
The System.Diagnostics namespace provides a class to write to the Windows event log.



Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.