OutputCacheSection.EnableOutputCache Property

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

Namespace: System.Web.Configuration
Assembly: System.Web (in system.web.dll)

public bool EnableOutputCache { get; set; }
/** @property */
public boolean get_EnableOutputCache ()

/** @property */
public void set_EnableOutputCache (boolean value)

public function get EnableOutputCache () : boolean

public function set EnableOutputCache (value : boolean)

Not applicable.

Property Value

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

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.

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

// Get the current EnabledOutputCache.
Boolean enabledOutputCache = 

// Set the EnabledOutputCache.
outputCacheSection.EnableOutputCache = false;

Windows 98, Windows Server 2000 SP4, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions