ProfileSection.Inherits Własność
Definicja
Ważny
Niektóre informacje dotyczą produktów przedpremierowych, które mogą zostać znacznie zmodyfikowane przed premierą. Microsoft nie udziela żadnych gwarancji, ani wyraźnych, ani domniemanych, dotyczących informacji podanych tutaj.
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ść nieruchomoś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 ProfileSection dla klasy .
// 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 pochodzącego z ProfileBaseklasy , a system kompilacji użyje tego typu niestandardowego jako klasy bazowej dla ProfileCommonklasy .
Uwaga
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 omówienie właściwości profilu ASP.NET.