PartialCachingAttribute.Duration 屬性

定義

取得快取項目應停留在輸出快取區中的時間 (以秒為單位)。

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

屬性值

使用者控制項應停留在輸出快取區中的時間 (以秒為單位)。

範例

下列程式碼範例示範如何將建 PartialCachingAttribute(Int32) 構函式套用至使用者控制項。 屬性工作表示可以快取使用者控制項,並指定 20 秒快取持續時間。 此程式碼範例是針對 類別提供的較大範例的 PartialCachingAttribute 一部分。

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

適用於