Condividi tramite


ProfileSection.AutomaticSaveEnabled Proprietà

Definizione

Ottiene o imposta un valore che determina se le modifiche apportate alle informazioni sul profilo utente vengono salvate automaticamente a chiusura della pagina.

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

Valore della proprietà

true se le informazioni sul profilo vengono salvate automaticamente a chiusura della pagina; in caso contrario, false. Il valore predefinito è true.

Attributi

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare la proprietà AutomaticSaveEnabled. Questo esempio di codice fa parte di un esempio più grande fornito per la ProfileSection classe.


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

Commenti

Quando la proprietà è false, le AutomaticSaveEnabled modifiche ai singoli profili non vengono salvate a meno che il SaveProfileCommon metodo della classe non venga chiamato nel codice. Quando la proprietà è true, l'evento ProfileAutoSaving consente anche al codice di eseguire l'override AutomaticSaveEnabled del comportamento di salvataggio automatico.

Si applica a

Vedi anche