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。