Freigeben über


ProfileSection.AutomaticSaveEnabled Eigenschaft

Definition

Dient zum Abrufen oder Festlegen eines Werts, der bestimmt, ob Änderungen an Benutzerprofilinformationen automatisch beim Beenden der Seite gespeichert werden.

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

Eigenschaftswert

truewenn Profilinformationen beim Beenden der Seite automatisch gespeichert werden; andernfalls . false Der Standardwert lautet true.

Attribute

Beispiele

Das folgende Codebeispiel zeigt, wie die AutomaticSaveEnabled Eigenschaft verwendet wird. Dieses Codebeispiel ist Teil eines größeren Beispiels, das für die ProfileSection Klasse bereitgestellt wird.


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

Hinweise

Wenn die AutomaticSaveEnabled Eigenschaft lautet false, werden Änderungen an einzelnen Profilen nicht gespeichert, es sei denn, die Save Methode der ProfileCommon Klasse wird im Code aufgerufen. Wenn die AutomaticSaveEnabled Eigenschaft lautet true, ermöglicht das ProfileAutoSaving Ereignis auch das Außerkraftsetzen des automatischen Speicherverhaltens durch Code.

Gilt für:

Weitere Informationen