Udostępnij za pośrednictwem


ProfileSection.Inherits Właściwość

Definicja

Pobiera lub ustawia odwołanie typu dla typu niestandardowego pochodzącego z ProfileBaseklasy .

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

Wartość właściwości

Prawidłowe odwołanie do typu lub pusty ciąg (""). Wartość domyślna to pusty ciąg.

Atrybuty

Przykłady

W poniższym przykładzie kodu pokazano, jak używać Inherits właściwości . Ten przykład kodu jest częścią większego przykładu udostępnionego dla klasy 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"

Uwagi

W czasie wykonywania system kompilacji ASP.NET używa informacji określonych w profile sekcji konfiguracji w celu wygenerowania klasy o nazwie ProfileCommon, która pochodzi z ProfileBaseklasy . Aby dostosować informacje zapewniane przez tę klasę, można ustawić Inherits właściwość na nazwę tworzonego typu, który pochodzi z ProfileBaseklasy , a system kompilacji będzie używać tego typu niestandardowego jako klasy bazowej dla ProfileCommonklasy .

Uwaga / Notatka

Jeśli podasz odwołanie do typu we Inherits właściwości, możesz zdefiniować właściwości w typach niestandardowych, które nie są zdefiniowane za pomocą property elementu.

Aby uzyskać więcej informacji na temat funkcji profilu dodanych do wersji ASP.NET 2.0, zobacz ASP.NET Omówienie właściwości profilu.

Dotyczy

Zobacz też