Skip to main content
.NET Framework 4.5.2+
  • The page you are viewing does not exist in the .NET Standard 2.0+ platform documentation. This link will take you to the parent topic of the current section.
  • The page you are viewing does not exist in the .NET 6.0+ platform documentation. This link will take you to the parent topic of the current section.

ErrorHandling Class

Provides static members for the error handling in ASP.NET Web Forms applications.

Namespace: DevExpress.ExpressApp.Web

Assembly: DevExpress.ExpressApp.Web.v22.1.dll

Declaration

public class ErrorHandling

The following members return ErrorHandling objects:

Remarks

The ErrorHandling is an auxiliary class that is used to handle errors occurring in ASP.NET Web Forms applications.

By default, the information related to the error that occurred is displayed, logged, and the application administrator receives an e-mail notification. This behavior is configurable via the configuration file (Web.config) options listed in the Error Handling in ASP.NET Web Forms Applications topic. Additionally, you can use the ErrorHandling.CustomSendErrorNotification and ErrorHandling.CustomSendMailMessage events to customize the notifications mechanism. You can subscribe to these events in the ASP.NET Web Forms application’s Session_Start method. This method’s code is located in the Global.asax.cs (Global.asax.vb) file of the ASP.NET Web Forms application project. The following snippet illustrates subscribing to the ErrorHandling.CustomSendMailMessage.

protected void Session_Start(object sender, EventArgs e) {
    WebApplication.SetInstance(Session, new MySolutionWebApplication());
    ErrorHandling.CustomSendMailMessage += 
        new EventHandler<CustomSendMailMessageEventArgs>(ErrorHandling_CustomSendMailMessage);
     // ...
    WebApplication.Instance.Setup();
    WebApplication.Instance.Start();
}

The default XAF web application project contains the Error.aspx.cs (Error.aspx.vb) file, where you can see examples of this class’ members in use.

The following code snippets (auto-collected from DevExpress Examples) contain references to the ErrorHandling class.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

Inheritance

Object
ErrorHandling
See Also