Condividi tramite


ProfileSection.Inherits Proprietà

Definizione

Ottiene o imposta un riferimento a un tipo per un tipo personalizzato derivato dall'oggetto 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

Valore della proprietà

Riferimento a un tipo valido o una stringa vuota (""). Il valore predefinito è una stringa vuota.

Attributi

Esempio

Nell'esempio di codice riportato di seguito viene illustrato come utilizzare la proprietà Inherits. Questo esempio di codice fa parte di un esempio più grande fornito per la ProfileSection classe.


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

Commenti

In fase di esecuzione, il sistema di compilazione ASP.NET usa le informazioni specificate nella profile sezione della configurazione per generare una classe denominata ProfileCommon, derivata da ProfileBase. Per personalizzare le informazioni fornite da questa classe, è possibile impostare la Inherits proprietà sul nome di un tipo creato che deriva da ProfileBasee il sistema di compilazione userà questo tipo personalizzato come classe di base per ProfileCommon.

Nota

Se si specifica un riferimento al tipo nella Inherits proprietà, è possibile definire le proprietà nei tipi personalizzati non definiti con un property elemento.

Per altre informazioni sulle funzionalità del profilo aggiunte a ASP.NET 2.0, vedere Panoramica delle proprietà del profilo ASP.NET.

Si applica a

Vedi anche