Export (0) Print
Expand All

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

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0
Show:
© 2015 Microsoft