CustomErrorsSection.Mode Property

Definition

Gets or sets the error display modality.

[System.Configuration.ConfigurationProperty("mode", DefaultValue=System.Web.Configuration.CustomErrorsMode.RemoteOnly)]
public System.Web.Configuration.CustomErrorsMode Mode { get; set; }

Property Value

One of the CustomErrorsMode values. The default is RemoteOnly.

Attributes

Examples

The following code example shows how to use the Mode property.

Refer to the code example in the CustomErrorsSection class topic to learn how to get the section.

// Get the current Mode.
CustomErrorsMode currentMode = 
    customErrorsSection.Mode;

// Set the current Mode.
customErrorsSection.Mode = 
    CustomErrorsMode.RemoteOnly;

Remarks

Specifies whether custom errors are enabled, disabled, or shown only to remote clients.

Applies to

Produk Versi
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1