VaryByControl Property

OutputCacheProfile.VaryByControl Property

 

Gets or sets the VaryByControl property.

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

[ConfigurationPropertyAttribute("varyByControl")]
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.

System_CAPS_noteNote

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 = 
    outputCacheProfile.VaryByControl;

// Set the VaryByControl.
outputCacheProfile.VaryByControl = 
    string.Empty;

.NET Framework
Available since 2.0
Return to top
Show:
© 2016 Microsoft