ControlCachePolicy.VaryByControl Property


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

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

public string VaryByControl { get; set; }

Property Value

Type: System.String

A semicolon-separated list of strings used to vary a user control's output cache. These strings represent the ID property values of ASP.NET server controls declared in the user control.

Exception Condition

The user control is not associated with a BasePartialCachingControl and is not cacheable.

- or -

The VaryByControl property is set outside of the initialization and rendering stages of the control.

.NET Framework
Available since 2.0
Return to top