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
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.
Use the @ OutputCache directive to enable output caching in declarative scenarios.
Use the System.Web.UI.PartialCachingAttribute to enable caching for a user control in a code-behind file.
Use the System.Web.UI.ControlCachePolicy class to programmatically specify cache settings in programmatic scenarios in which you are working with System.Web.UI.BasePartialCachingControl instances.
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.