EnableFragmentCache Property

OutputCacheSection.EnableFragmentCache Property

 

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

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

[ConfigurationPropertyAttribute("enableFragmentCache", DefaultValue = true)]
public bool EnableFragmentCache { get; set; }

Property Value

Type: System.Boolean

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

If the EnableFragmentCache property is set to false, no user control output is cached, regardless of the @ OutputCache directive or caching profile used. For more information, see OutputCacheSettingsSection and OutputCacheProfile.

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


// Get the current EnabledFragmentCache.
Boolean enabledFragmentCache =
    outputCacheSection.EnableFragmentCache;

// Set the EnabledFragmentCache.
outputCacheSection.EnableFragmentCache = false;

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft