ProfileSection.Enabled Property

Definition

Gets or sets a value indicating whether the ASP.NET profile feature is enabled.

[System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)]
public bool Enabled { get; set; }

Property Value

true if the ASP.NET compilation system should generate a ProfileCommon class that can be used to access information about individual user profiles; otherwise, false. The default is true.

Attributes

Examples

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


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

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

Remarks

When the Enabled property is false, the profile feature is disabled, and you will not be able to access user-profile information from your ASP.NET code.

When the property is true, at run time the ASP.NET compilation system uses the information specified in the profile section to generate a class called ProfileCommon, which is derived from ProfileBase.

Applies to

Product Versions
.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