共用方式為


PartialCachingAttribute.VaryByParams 屬性

定義

取得查詢字串的清單,或是輸出快取將用於變更使用者控制項的表單 POST 參數。

public:
 property System::String ^ VaryByParams { System::String ^ get(); };
public:
 property System::String ^ VaryByParams { System::String ^ get(); void set(System::String ^ value); };
public string VaryByParams { get; }
public string VaryByParams { get; set; }
member this.VaryByParams : string
member this.VaryByParams : string with get, set
Public ReadOnly Property VaryByParams As String
Public Property VaryByParams As String

屬性值

查詢字串的清單或表單 POST 參數。

範例

下列程式碼範例示範如何將建 PartialCachingAttribute(Int32, String, String, String) 構函式套用至使用者控制項。 在此範例中,建構函式用來指出可以快取使用者控制項,以及指定快取專案相依的參數。

// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByParams
// property to ctlSelect.country, the full name of the form 
// POST parameter generated by the country DropDownList control.
[PartialCaching(20, "ctlSelect.country", null, null)]
public partial class ctlSelect : UserControl
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByParams
' property to ctlSelect.country, the full name of the form 
' POST parameter generated by the country DropDownList control.
<PartialCaching(20, "ctlSelect.country", Nothing, Nothing)> _
Public Class ctlSelect
    Inherits UserControl

適用於