System.Web.UI.PartialCachingAttribute Class

Defines the metadata attribute that Web Forms user controls (.ascx files) use to indicate if and how their output is cached. This class cannot be inherited.

See Also: PartialCachingAttribute Members


public sealed class PartialCachingAttribute : Attribute


The System.Web.UI.PartialCachingAttribute attribute class marks user controls (.ascx files) that support fragment caching, and encapsulates the cache settings that ASP.NET uses when caching the control. Page and controls developers use the System.Web.UI.PartialCachingAttribute attribute to enable output caching for a user control in a code-behind file.

Using the System.Web.UI.PartialCachingAttribute is one of several ways you can enable output caching. The following list describes methods you can use to enable output caching.

If a user control contains an @ OutputCache directive or has a System.Web.UI.PartialCachingAttribute applied, the ASP.NET parser generates an instance of the System.Web.UI.PartialCachingControl class to wrap the user control.

For more information about ASP.NET caching, see ASP.NET Caching Features. For more information about using attributes, see Extending Metadata Using Attributes.


Namespace: System.Web.UI
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 1.0.5000.0,