Επεξεργασία

Κοινή χρήση μέσω


ProfileSection.Inherits Property

Definition

Gets or sets a type reference for a custom type derived from ProfileBase.

public:
 property System::String ^ Inherits { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("inherits", DefaultValue="")]
public string Inherits { get; set; }
[<System.Configuration.ConfigurationProperty("inherits", DefaultValue="")>]
member this.Inherits : string with get, set
Public Property Inherits As String

Property Value

A valid type reference, or an empty string (""). The default is an empty string.

Attributes

Examples

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


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

// Set the Inherits property to
// "CustomProfiles.MyCustomProfile, CustomProfiles.dll".
profileSection.Inherits = "CustomProfiles.MyCustomProfile, CustomProfiles.dll";

' Get the current Inherits property value.
Console.WriteLine( _
    "Current Inherits value: '{0}'", profileSection.Inherits)

' Set the Inherits property to
' "CustomProfiles.MyCustomProfile, CustomProfiles.dll".
profileSection.Inherits = "CustomProfiles.MyCustomProfile, CustomProfiles.dll"

Remarks

At run time, the ASP.NET compilation system uses the information specified in the profile section of the configuration to generate a class called ProfileCommon, which is derived from ProfileBase. To customize the information this class provides, you can set the Inherits property to the name of a type you create that derives from ProfileBase, and the compilation system will use this custom type as the base class for ProfileCommon.

Note

If you provide a type reference in the Inherits property, you can define properties in your custom types that are not defined with a property element.

For more information about the profile features added to ASP.NET 2.0, see ASP.NET Profile Properties Overview.

Applies to

See also