ProfileSection.Inherits Egenskap

Definition

Hämtar eller anger en typreferens för en anpassad typ som härletts från 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

Egenskapsvärde

En giltig typreferens eller en tom sträng (""). Standardvärdet är en tom sträng.

Attribut

Exempel

Följande kodexempel visar hur du använder egenskapen Inherits . Det här kodexemplet är en del av ett större exempel för ProfileSection klassen.


// 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"

Kommentarer

Vid körning använder ASP.NET kompileringssystemet den information som anges i avsnittet profile i konfigurationen för att generera en klass med namnet ProfileCommon, som härleds från ProfileBase. Om du vill anpassa den information som den här klassen innehåller kan du ange Inherits egenskapen till namnet på en typ som du skapar som härleds från ProfileBase, och kompileringssystemet använder den här anpassade typen som basklass för ProfileCommon.

Note

Om du anger en typreferens i Inherits egenskapen kan du definiera egenskaper i dina anpassade typer som inte har definierats med ett property element.

Mer information om profilfunktionerna som lagts till i ASP.NET 2.0 finns i ASP.NET Översikt över profilegenskaper.

Gäller för

Se även