Skip to main content
.NET Framework 4.6.2+
  • The page you are viewing does not exist in the .NET 8.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.v24.2.dll

NuGet Package: DevExpress.ExpressApp.Web

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.

Inheritance

Object
ErrorHandling
See Also