OutputCacheProfile.VaryByCustom Property


Gets or sets the VaryByCustom property.

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

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.


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 = 

// Set the VaryByCustom.
outputCacheProfile.VaryByCustom = 

.NET Framework
Available since 2.0
Return to top