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

适用于

另请参阅