OutputCacheProfile.VaryByControl Property


Gets or sets the VaryByControl property.

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

public string VaryByControl { get; set; }

Property Value

Type: System.String

The VaryByControl value.

The VaryByControl is a semicolon-delimited set of IDs of controls to be cached.

For more information, see Caching Multiple Versions of User Control Output.


The VaryByControl settings are the same ones used by the VaryByControls attribute of the directive.

The following code example shows how to use the VaryByControl property.

// Get the current VaryByControl.
String varyByControlValue = 

// Set the VaryByControl.
outputCacheProfile.VaryByControl = 

.NET Framework
Available since 2.0
Return to top