Bagikan melalui


ProfileSection.Enabled Properti

Definisi

Mendapatkan atau menetapkan nilai yang menunjukkan apakah fitur profil ASP.NET diaktifkan.

public:
 property bool Enabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)]
public bool Enabled { get; set; }
[<System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)>]
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

Nilai Properti

true jika sistem kompilasi ASP.NET harus menghasilkan ProfileCommon kelas yang dapat digunakan untuk mengakses informasi tentang profil pengguna individu; jika tidak, false. Defaultnya adalah true.

Atribut

Contoh

Contoh kode berikut menunjukkan cara menggunakan Enabled properti . Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk ProfileSection kelas .


// Get the current Enabled property value.
Console.WriteLine(
    "Current Enabled value: '{0}'", profileSection.Enabled);

// Set the Enabled property to false.
profileSection.Enabled = false;

' Get the current Enabled property value.
Console.WriteLine( _
    "Current Enabled value: '{0}'", profileSection.Enabled)

' Set the Enabled property to false.
profileSection.Enabled = false

Keterangan

Enabled Ketika properti adalah false, fitur profil dinonaktifkan, dan Anda tidak akan dapat mengakses informasi profil pengguna dari kode ASP.NET Anda.

Ketika properti adalah true, pada waktu proses, sistem kompilasi ASP.NET menggunakan informasi yang ditentukan di profile bagian untuk menghasilkan kelas yang disebut ProfileCommon, yang berasal dari ProfileBase.

Berlaku untuk

Lihat juga