ErrorHandling Class

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

Namespace: DevExpress.ExpressApp.Web

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

Declaration

public class ErrorHandling
Public Class ErrorHandling

The ErrorHandling is an auxiliary class that is used to handle errors occurring in ASP.NET 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 and Mobile 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 application's Session_Start method. This method's code is located in the Global.asax.cs (Global.asax.vb) file of the ASP.NET 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