HttpApplication.GetVaryByCustomString(HttpContext, String) 方法

定義

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

C#
public virtual string GetVaryByCustomString(System.Web.HttpContext context, string custom);

參數

context
HttpContext

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

custom
String

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

傳回

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

備註

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

適用於

產品 版本
.NET Framework 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1

另請參閱