Sdílet prostřednictvím


ProfileSection.Inherits Vlastnost

Definice

Získá nebo nastaví odkaz na typ pro vlastní typ odvozený z 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

Hodnota vlastnosti

Platný odkaz na typ nebo prázdný řetězec (""). Výchozí hodnota je prázdný řetězec.

Atributy

Příklady

Následující příklad kódu ukazuje, jak použít Inherits vlastnost. Tento příklad kódu je součástí většího příkladu ProfileSection pro třídu.


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

Poznámky

Za běhu ASP.NET kompilační systém používá informace zadané v profile části konfigurace k vygenerování třídy s názvem ProfileCommon, která je odvozena z ProfileBase. Chcete-li přizpůsobit informace, které tato třída poskytuje, můžete nastavit Inherits vlastnost na název typu, který vytvoříte, který je odvozen od ProfileBasea kompilační systém bude používat tento vlastní typ jako základní třídu pro ProfileCommon.

Poznámka

Pokud do vlastnosti zadáte odkaz na Inherits typ, můžete ve vlastních typech definovat vlastnosti, které nejsou definovány pomocí elementu property .

Další informace o funkcích profilu přidaných do ASP.NET 2.0 najdete v tématu Přehled vlastností profilu ASP.NET.

Platí pro

Viz také