PartialCachingAttribute.VaryByParams 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取输出缓存将用于改变用户控件的查询字符串或窗体 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