Redigera

Dela via


ProfileSection.Enabled Property

Definition

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

public:
 property bool Enabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)]
public bool Enabled { get; set; }
[<System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)>]
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

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;

' 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

See also