Прочитај на енглеском Уреди

Делите путем


ProfileSection.AutomaticSaveEnabled Property

Definition

Gets or sets a value that determines whether changes to user-profile information are automatically saved on page exit.

C#
[System.Configuration.ConfigurationProperty("automaticSaveEnabled", DefaultValue=true)]
public bool AutomaticSaveEnabled { get; set; }

Property Value

true if profile information is automatically saved on page exit; otherwise, false. The default is true.

Attributes

Examples

The following code example shows how to use the AutomaticSaveEnabled property. This code example is part of a larger example provided for the ProfileSection class.

C#

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

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

Remarks

When the AutomaticSaveEnabled property is false, changes to individual profiles are not saved unless the Save method of the ProfileCommon class is called in code. When the AutomaticSaveEnabled property is true, the ProfileAutoSaving event also allows code to override the automatic save behavior.

Applies to

Производ Верзије
.NET Framework 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

See also