共用方式為


OutputCacheSection.EnableOutputCache 屬性

定義

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

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 指令或快取設定檔中如何設定,伺服器上不會有快取頁面。 如需詳細資訊,請參閱 OutputCacheSettingsSectionOutputCacheProfile

適用於

另請參閱