ProfileSection.Inherits Properti
Definisi
Penting
Beberapa informasi terkait produk prarilis yang dapat diubah secara signifikan sebelum dirilis. Microsoft tidak memberikan jaminan, tersirat maupun tersurat, sehubungan dengan informasi yang diberikan di sini.
Mendapatkan atau mengatur referensi jenis untuk jenis kustom yang berasal dari 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
Nilai Properti
Referensi jenis yang valid, atau string kosong (""). Defaultnya adalah string kosong.
- Atribut
Contoh
Contoh kode berikut menunjukkan cara menggunakan Inherits properti . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk ProfileSection kelas .
// 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"
Keterangan
Pada durasi, sistem kompilasi ASP.NET menggunakan informasi yang ditentukan di profile
bagian konfigurasi untuk menghasilkan kelas yang disebut ProfileCommon
, yang berasal dari ProfileBase. Untuk menyesuaikan informasi yang disediakan kelas ini, Anda dapat mengatur Inherits properti ke nama jenis yang Anda buat yang berasal dari ProfileBase, dan sistem kompilasi akan menggunakan jenis kustom ini sebagai kelas dasar untuk ProfileCommon
.
Catatan
Jika Anda memberikan referensi jenis di Inherits properti , Anda dapat menentukan properti dalam jenis kustom Yang tidak ditentukan dengan property
elemen .
Untuk informasi selengkapnya tentang fitur profil yang ditambahkan ke ASP.NET 2.0, lihat Gambaran Umum Properti Profil ASP.NET.
Berlaku untuk
Lihat juga
Saran dan Komentar
https://aka.ms/ContentUserFeedback.
Segera hadir: Sepanjang tahun 2024 kami akan menghentikan penggunaan GitHub Issues sebagai mekanisme umpan balik untuk konten dan menggantinya dengan sistem umpan balik baru. Untuk mengetahui informasi selengkapnya, lihat:Kirim dan lihat umpan balik untuk