System.Web 2.0.0.0 System.Object

The class is used by developers in programmatic user control scenarios to specify output caching settings for user controls (.ascx files). ASP.NET embeds user controls within a instance. The class represents a user control that has output caching enabled. When you access the property of a control, you will always receive a valid object. However, if you access the property of a control, you receive a valid object only if the user control is already wrapped by a control. If it is not wrapped, the object returned by the property will throw exceptions when you attempt to manipulate it because it does not have an associated . To determine whether a instance supports caching without generating exceptions, inspect the property.

Using the class 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 attribute to enable caching for a user control in a code-behind file.

Use the class to specify cache settings in programmatic scenarios in which you are working with instances that have been cache-enabled using one of the previous methods and dynamically loaded using the method. A instance can be successfully manipulated only between the Init and PreRender stages of the control life cycle. If you modify a object after the PreRender phase, ASP.NET throws an exception, because any changes made after the control is rendered cannot actually affect cache settings (a control is cached during the Render stage). Finally, a user control instance (and therefore its object) is only available for programmatic manipulation when it is actually rendered.

Provides programmatic access to an ASP.NET user control's output cache settings.

- Property
  System.Boolean To be added. To be added.

  Gets or sets a value indicating whether fragment caching is enabled for the user control.

  2.0.0.0
- Property
  System.Web.Caching.CacheDependency To be added.

  The property delegates to the property of the control that wraps the user control. When the instance is invalidated, the user control is removed from the cache.

  Gets or sets an instance of the class associated with the cached user control output.

  2.0.0.0
- Property
  System.TimeSpan To be added.

  If an absolute expiration policy is set using the method, the property returns the amount of time remaining until cache entry expiration.

  Gets or sets the amount of time that cached items are to remain in the output cache.

  2.0.0.0
- Method
  System.Void ``

  Use the and methods (passing true) to instruct the control that wraps the user control to use a sliding expiration caching policy instead of an absolute expiration policy. Use the method and the method (passing false) to specify an absolute expiration policy.

  Instructs the control that wraps the user control to expire the cache entry at the specified date and time.

  A after which the cached entry expires. 2.0.0.0
- Method
  System.Void ``

  Use the and methods (passing true) to instruct the control that wraps the user control to use a sliding expiration caching policy instead of an absolute expiration policy. Use the method and the method (passing false) to specify an absolute expiration policy.

  Instructs the control that wraps the user control to set the user control's cache entry to use sliding or absolute expiration.

  true to use sliding cache expiration instead of absolute expiration; otherwise, false. 2.0.0.0
- Method
  System.Void ``

  If you pass "browser" as the parameter, the user control will be varied by browser type and major version number. If another custom string is entered, you must override the method in your application's Global.asax file.

  Sets a list of custom strings that the output cache will use to vary the user control.

  The list of custom strings. 2.0.0.0
- Property
  System.Boolean To be added.

  A user control supports caching if it is associated with a instance, which signals that either an @ OutputCache directive was parsed by the ASP.NET parser or the user control was decorated with a attribute.

  Gets a value indicating whether the user control supports caching.

  2.0.0.0
- Property
  System.String To be added. To be added.

  Gets or sets a list of control identifiers to vary the cached output by.

  2.0.0.0
- Property
  System.Web.HttpCacheVaryByParams To be added.

  By default, these strings correspond to a query string value sent with the GET method or to a parameter sent using the POST method. When the property is set to multiple parameters, the output cache contains a different version of the requested document for each specified parameter. Possible values include "none", "*", and any valid query string or POST parameter name.

  Gets or sets a list of GET or POST parameter names to vary the cached output by.

  2.0.0.0