共用方式為


ProfileSection.AutomaticSaveEnabled 屬性

定義

取得或設定一個值,決定頁面結束時是否自動儲存使用者個人資料資訊的變更。

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

屬性值

true如果個人檔案資訊會在頁面退出時自動儲存;否則,。 false 預設值為 true

屬性

範例

以下程式碼範例說明如何使用該 AutomaticSaveEnabled 屬性。 此程式碼範例是本類別更大範例 ProfileSection 的一部分。


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

// Set the AutomaticSaveEnabled property to false.
profileSection.AutomaticSaveEnabled = false;

' Get the current AutomaticSaveEnabled property value.
Console.WriteLine( _
    "Current AutomaticSaveEnabled value: '{0}'", profileSection.AutomaticSaveEnabled)

' Set the AutomaticSaveEnabled property to false.
profileSection.AutomaticSaveEnabled = false

備註

當屬性 AutomaticSaveEnabledfalse時,除非 Save 在程式碼中呼叫該類別的方法 ProfileCommon ,否則對個別設定檔的變更不會被保存。 當屬性 AutomaticSaveEnabledtrue時, ProfileAutoSaving 事件也允許程式碼覆寫自動存檔行為。

適用於

另請參閱