PartialCachingAttribute.Duration 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
讀取快取項目應該在輸出快取中停留的時間(以秒計)。
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