Szerkesztés

Megosztás a következőn keresztül:


OutputCacheSection.EnableOutputCache Property

Definition

Gets or sets a value indicating whether the output cache is enabled.

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

Property Value

true if the output cache is enabled; otherwise, false. The default is true.

Attributes

Examples

The following code example shows how to use the EnableOutputCache property.


// 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

Remarks

If the EnableFragmentCache property is set to false, no page is cached on the server, regardless of the settings in @ OutputCache directive or caching profile used by the page. For more information, see OutputCacheSettingsSection and OutputCacheProfile.

Applies to

See also