共用方式為


OutputCacheSection.EnableFragmentCache 屬性

定義

取得或設定一個值,表示片段快取是否啟用。

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 指令或快取配置檔,都不會快取使用者控制輸出。 如需詳細資訊,請參閱 OutputCacheSettingsSectionOutputCacheProfile

適用於

另請參閱