This documentation is archived and is not being maintained.

HttpApplication.GetVaryByCustomString Method

Provides an application-wide implementation of the VaryByCustom property.

[Visual Basic]
Public Overridable Function GetVaryByCustomString( _
   ByVal context As HttpContext, _
   ByVal custom As String _
) As String
public virtual string GetVaryByCustomString(
 HttpContext context,
 string custom
public: virtual String* GetVaryByCustomString(
 HttpContext* context,
 String* custom
public function GetVaryByCustomString(
   context : HttpContext,
 custom : String
) : String;


An HttpContext that contains information about the current Web request
The custom string that specifies which cached response is used to response to the current request.

Return Value

If the value of the custom parameter is "browser", the browser's Type; otherwise, a null reference (Nothing in Visual Basic).


You can override GetVaryByCustomString to add a new method for calculating custom vary-by values based on the current request. The implementation has to call the base class for custom values that it does not recognize. For more information, see Caching Versions of a Page, Based on Custom Strings.


Platforms: Windows 2000, Windows XP Professional, Windows Server 2003 family

See Also

HttpApplication Class | HttpApplication Members | System.Web Namespace | Caching Versions of a Page, Based on Custom Strings