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

属性值

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

适用于

另请参阅