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

属性值

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

适用于