HttpApplication.GetVaryByCustomString(HttpContext, String) 方法

定義

提供 VaryByCustom 屬性的全應用程式實作。

public:
 virtual System::String ^ GetVaryByCustomString(System::Web::HttpContext ^ context, System::String ^ custom);
public virtual string GetVaryByCustomString (System.Web.HttpContext context, string custom);
abstract member GetVaryByCustomString : System.Web.HttpContext * string -> string
override this.GetVaryByCustomString : System.Web.HttpContext * string -> string
Public Overridable Function GetVaryByCustomString (context As HttpContext, custom As String) As String

參數

context
HttpContext

包含目前 Web 要求之相關資訊的 HttpContext 物件。

custom
String

自訂字串,指定哪一個快取回應是用於回應目前的要求。

傳回

String

如果 custom 參數的值是 "browser",則為瀏覽器的 Type,否則為 null

備註

您可以覆寫 GetVaryByCustomString 以新增方法,以根據目前的要求計算自訂不同值。 實作必須針對無法辨識的自訂值呼叫基類。 如需詳細資訊,請參閱 如何:使用自訂字串快取頁面的版本

適用於

另請參閱