OutputCacheProfile.Enabled 属性

定义

获取或设置一个值,该值指示是否启用缓存。

public:
 property bool Enabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)]
public bool Enabled { get; set; }
[<System.Configuration.ConfigurationProperty("enabled", DefaultValue=true)>]
member this.Enabled : bool with get, set
Public Property Enabled As Boolean

属性值

Boolean

如果启用缓存,则为 true;否则为 false。 默认值是 false

属性

示例

下面的代码示例说明如何使用 Enabled 属性。


 // Get the current Enabled.
Boolean enabledValue = 
    outputCacheProfile.Enabled;

 // Set the Enabled.
 outputCacheProfile.Enabled = 
     false;
    ' Get the current Enabled property.
    Dim enabledValue As [Boolean] = _
    outputCacheProfile.Enabled
  
    ' Set the Enabled property.
outputCacheProfile.Enabled = False

注解

Enabled 属性仅允许在一个位置启用或禁用缓存机制。 它会影响使用此 OutputCacheProfile内容的所有页面或控件。

适用于

另请参阅