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 uvedeného pro třídu ProfileSection.


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

V době běhu používá ASP.NET systém kompilace informace uvedené v profile části konfigurace k vygenerování třídy volaného ProfileCommon, který je odvozen z ProfileBase. Chcete-li přizpůsobit informace, které tato třída poskytuje, můžete nastavit Inherits vlastnost na název typu, který je odvozen od ProfileBase, a systém kompilace 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 definovat vlastnosti ve vlastních typech, 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 ASP.NET Přehled vlastností profilu.

Platí pro

Viz také