PartialCachingAttribute.Duration Properti

Definisi

Mendapatkan jumlah waktu, dalam detik, item yang di-cache harus tetap berada di cache output.

public:
 property int Duration { int get(); };
public:
 property int Duration { int get(); void set(int value); };
public int Duration { get; }
public int Duration { get; set; }
member this.Duration : int
member this.Duration : int with get, set
Public ReadOnly Property Duration As Integer
Public Property Duration As Integer

Nilai Properti

Jumlah waktu, dalam detik, kontrol pengguna harus tetap berada di cache output.

Contoh

Contoh kode berikut menunjukkan bagaimana PartialCachingAttribute(Int32) konstruktor dapat diterapkan ke kontrol pengguna. Atribut menunjukkan bahwa kontrol pengguna dapat di-cache dan menentukan durasi penembolokan 20 detik. Contoh kode ini adalah bagian dari contoh yang lebih besar yang disediakan untuk PartialCachingAttribute kelas .

// Set the PartialCachingAttribute.Duration property to 20 seconds.
[PartialCaching(20)]
public partial class ctlMine : UserControl
' Set the PartialCachingAttribute.Duration property to 20 seconds.
<PartialCaching(20)> _
Partial Class ctlMine
    Inherits UserControl

Berlaku untuk