PartialCachingAttribute.VaryByControls 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 daftar properti kontrol pengguna yang digunakan cache output untuk memvariasikan kontrol pengguna.
public:
property System::String ^ VaryByControls { System::String ^ get(); };
public:
property System::String ^ VaryByControls { System::String ^ get(); void set(System::String ^ value); };
public string VaryByControls { get; }
public string VaryByControls { get; set; }
member this.VaryByControls : string
member this.VaryByControls : string with get, set
Public ReadOnly Property VaryByControls As String
Public Property VaryByControls As String
Nilai Properti
Daftar properti kontrol pengguna.
Contoh
Contoh kode berikut menunjukkan bagaimana PartialCachingAttribute(Int32, String, String, String) konstruktor dapat diterapkan ke kontrol pengguna. Dalam contoh, konstruktor digunakan untuk menunjukkan bahwa kontrol pengguna dapat di-cache, untuk menentukan durasi penembolokan sebagai 20 detik, dan untuk menentukan kontrol bernama state yang output kontrol penggunanya akan bervariasi.
// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByControls
// property to the ID of the server control to vary the output by.
// In this case, it is state, the ID assigned to a DropDownList
// server control.
[PartialCaching(20, null, "state", null)]
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByControls
' property to the ID of the server control to vary the output by.
' In this case, it is state, the ID assigned to a DropDownList
' server control.
<PartialCaching(20, Nothing, "state", Nothing)> _
Public Class ctlSelect
Inherits UserControl