共用方式為


CustomErrorsSection.Mode 屬性

定義

取得或設定錯誤顯示強制回應性。

public:
 property System::Web::Configuration::CustomErrorsMode Mode { System::Web::Configuration::CustomErrorsMode get(); void set(System::Web::Configuration::CustomErrorsMode value); };
[System.Configuration.ConfigurationProperty("mode", DefaultValue=System.Web.Configuration.CustomErrorsMode.RemoteOnly)]
public System.Web.Configuration.CustomErrorsMode Mode { get; set; }
[<System.Configuration.ConfigurationProperty("mode", DefaultValue=System.Web.Configuration.CustomErrorsMode.RemoteOnly)>]
member this.Mode : System.Web.Configuration.CustomErrorsMode with get, set
Public Property Mode As CustomErrorsMode

屬性值

其中一個 CustomErrorsMode 值。 預設值為 RemoteOnly

屬性

範例

下列程式碼範例示範如何使用 Mode 屬性。

請參閱類別主題中的 CustomErrorsSection 程式碼範例,以瞭解如何取得區段。

// 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

備註

指定自訂錯誤是啟用、停用還是只對遠端用戶端顯示。

適用於