CustomErrorsMode 枚举

定义

指定自定义错误模式的值。Specifies the values for the custom errors modality.

public enum class CustomErrorsMode
public enum CustomErrorsMode
type CustomErrorsMode = 
Public Enum CustomErrorsMode
继承
CustomErrorsMode

字段

Off 2

禁用自定义错误,并允许显示标准错误。Disables custom errors, allowing display of standard errors.

On 1

启用自定义错误。Enables custom errors. 如果没有指定 DefaultRedirect,则发出标准错误。If no DefaultRedirect is specified, standard errors are issued.

RemoteOnly 0

仅在远程客户端上启用自定义错误。Enables custom errors on remote clients only. 仅向远程客户端显示自定义错误,而在本地主机显示 ASP.NET 错误。Custom errors are shown only to remote clients and ASP.NET errors are shown to the local host.

示例

下面的代码示例演示如何设置 Mode 属性。The following code example shows how to set the Mode property.

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

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

' Get the current Mode.
  Dim currentMode _
  As CustomErrorsMode = customErrorsSection.Mode

' Set the current Mode.
  customErrorsSection.Mode = _
  CustomErrorsMode.RemoteOnly

注解

CustomErrorsMode 枚举Mode设置属性时可以使用的值。The CustomErrorsMode enumerates the values you can use when setting the Mode property. 这些值定义是启用、禁用还是仅向远程客户端显示自定义错误。These values define whether custom errors are enabled, disabled, or shown only to remote clients.

适用于

另请参阅