共用方式為


PagesSection.EnableViewState 屬性

定義

會取得或設定一個值,指示視圖狀態是否啟用或停用。

public:
 property bool EnableViewState { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enableViewState", DefaultValue=true)]
public bool EnableViewState { get; set; }
[<System.Configuration.ConfigurationProperty("enableViewState", DefaultValue=true)>]
member this.EnableViewState : bool with get, set
Public Property EnableViewState As Boolean

屬性值

true 若啟用檢視狀態; false 如果檢視狀態被停用。 預設值為 true

屬性

範例

以下程式碼範例說明如何使用該 EnableViewState 屬性。

// Get the current EnableViewState property value.
Console.WriteLine(
    "Current EnableViewState value: '{0}'",
    pagesSection.EnableViewState);

// Set the EnableViewState property to false.
pagesSection.EnableViewState = false;
' Get the current EnableViewState property value.
Console.WriteLine( _
    "Current EnableViewState value: '{0}'", _
    pagesSection.EnableViewState)

' Set the EnableViewState property to false.
pagesSection.EnableViewState = False

適用於

另請參閱