OutputCacheProfile.VaryByCustom Property

 

Gets or sets the VaryByCustom property.

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

[ConfigurationPropertyAttribute("varyByCustom")]
public string VaryByCustom { get; set; }

Property Value

Type: System.String

The VaryByCustom value.

The VaryByCustom can be any text that represents custom output-caching requirements. If a custom string is entered, you must override the GetVaryByCustomString method in the application's Global.asax file.

System_CAPS_noteNote

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

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


// Get the current VaryByCustom.
String varyByCustomValue = 
    outputCacheProfile.VaryByCustom;

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

.NET Framework
Available since 2.0
Return to top
Show: