語言

OutputCacheProfile.VaryByParam 屬性

定義

取得或設定該 VaryByParam 屬性。

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

屬性值

VaryByParam 值。

屬性

範例

以下程式碼範例說明如何使用該 VaryByParam 屬性。


// Get the current VaryByParam.
String varyByParamValue = 
    outputCacheProfile.VaryByParam;

// Set the VaryByParam.
outputCacheProfile.VaryByParam = 
    string.Empty;
  ' Get the current VaryByParam property.
  Dim varyByParamValue As String = _
  outputCacheProfile.VaryByParam

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

備註

這是 VaryByParam 一組以分號分隔的參數,用來改變快取輸出。 它允許透過 GET 查詢字串或 POST 參數來調整快取輸出。 例如,你可以透過指定使用者控制名稱以及查詢字串或表單 POST 參數來改變快取的使用者控制輸出。 欲了解更多資訊,請參閱「 快取多版本使用者控制輸出」。

VaryByParam設定必須在@ OutputCache設定檔或使用設定檔的頁面指令中定義。

Note

這些OutputCacheProfile.VaryByParam設定與 VaryByParam 屬性所用相同。 不建議透過設定「*」來改變所有參數。 這可能導致快取溢位或網頁伺服器遭到阻斷服務攻擊。

適用於

另請參閱