Поделиться через


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

Комментарии

AutomaticSaveEnabled Если свойство имеет значениеfalse, изменения отдельных профилей не сохраняются, если Save метод ProfileCommon класса не вызывается в коде. AutomaticSaveEnabled Если свойство имеет значениеtrue, ProfileAutoSaving событие также позволяет коду переопределить поведение автоматического сохранения.

Применяется к

См. также раздел