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 如果启用了片段缓存,则为否则,为 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。