ProfileSection.Enabled Property
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
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
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
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.
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 |
.NET feedback
.NET is an open source project. Select a link to provide feedback: