CustomErrorsMode CustomErrorsMode CustomErrorsMode CustomErrorsMode Enum

定義

指定自訂錯誤強制回應性的值。Specifies the values for the custom errors modality.

public enum class CustomErrorsMode
public enum CustomErrorsMode
type CustomErrorsMode = 
Public Enum CustomErrorsMode
繼承
CustomErrorsModeCustomErrorsModeCustomErrorsModeCustomErrorsMode

欄位

Off Off Off Off 2

停用自訂錯誤,允許顯示標準錯誤。Disables custom errors, allowing display of standard errors.

On On On On 1

啟用自訂錯誤。Enables custom errors. 如果沒有指定 DefaultRedirect,就會發出標準錯誤。If no DefaultRedirect is specified, standard errors are issued.

RemoteOnly RemoteOnly RemoteOnly 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.

適用於

另請參閱