OutputCacheSection.EnableOutputCache 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得或設定一個值,表示輸出快取是否啟用。
public:
property bool EnableOutputCache { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enableOutputCache", DefaultValue=true)]
public bool EnableOutputCache { get; set; }
[<System.Configuration.ConfigurationProperty("enableOutputCache", DefaultValue=true)>]
member this.EnableOutputCache : bool with get, set
Public Property EnableOutputCache As Boolean
屬性值
true如果輸出快取已啟用;否則,。 false 預設值為 true。
- 屬性
範例
以下程式碼範例說明如何使用該 EnableOutputCache 屬性。
// Get the current EnabledOutputCache.
Boolean enabledOutputCache =
outputCacheSection.EnableOutputCache;
// Set the EnabledOutputCache.
outputCacheSection.EnableOutputCache = false;
' Get the current EnabledOutputCache.
Dim enabledOutputCache As [Boolean] = _
outputCacheSection.EnableOutputCache
' Set the EnabledOutputCache.
outputCacheSection.EnableOutputCache = False
備註
若 EnableFragmentCache 將屬性設定為 false,無論該頁面在 @ OutputCache 指令或快取設定檔中如何設定,伺服器上不會有快取頁面。 如需詳細資訊,請參閱 OutputCacheSettingsSection 和 OutputCacheProfile。