System.Web.Configuration.CustomError Class

Configures a System.Web.Configuration.CustomError section to map an ASP.NET error code to a custom page. This class cannot be inherited.

See Also: CustomError Members


public sealed class CustomError : System.Configuration.ConfigurationElement


The System.Web.Configuration.CustomError class provides a way to programmatically access and modify the error section of a configuration file. This type is part of a group that includes the System.Web.Configuration.CustomErrorCollection, System.Web.Configuration.CustomErrorsMode, and System.Web.Configuration.CustomErrorsSection.


When you define a custom error, ASP.NET assigns to it the standard error normally issued by the underlying service, such as IIS. For instance, if you define a custom error for the status code 404, ASP.NET will issue it anytime you refer to a non-existing .aspx page. The custom errors are only issued for those elements handled by ASP.NET. For instance, if you refer to a non-existing .htm page, IIS issues the standard 404 error.


Namespace: System.Web.Configuration
Assembly: System.Web (in System.Web.dll)
Assembly Versions:
Since: .NET 2.0