Share via


OutputCacheProfile.VaryByCustom 屬性

定義

取得或設定 VaryByCustom 屬性。

public:
 property System::String ^ VaryByCustom { System::String ^ get(); void set(System::String ^ value); };
[System.Configuration.ConfigurationProperty("varyByCustom")]
public string VaryByCustom { get; set; }
[<System.Configuration.ConfigurationProperty("varyByCustom")>]
member this.VaryByCustom : string with get, set
Public Property VaryByCustom As String

屬性值

String

VaryByCustom 值。

屬性

範例

下列程式碼範例示範如何使用 VaryByCustom 屬性。


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

// Set the VaryByCustom.
outputCacheProfile.VaryByCustom = 
    string.Empty;
  ' Get the current VaryByCustom.
  Dim varyByCustomValue As String = _
  outputCacheProfile.VaryByCustom

  ' Set the VaryByCustom property.
  outputCacheProfile.VaryByCustom = _
  String.Empty

備註

VaryByCustom可以是任何代表自訂輸出快取需求的文字。 如果輸入自訂字串,您必須覆寫 GetVaryByCustomString 應用程式 Global.asax 檔案中的 方法。

注意

這些 VaryByCustom 設定與 指示詞的 @ OutputCache 屬性所使用的 VaryByCustom 設定相同。

適用於

另請參閱