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