OutputCacheProfile.VaryByParam 属性
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
获取或设置 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页面的指令中定义该设置。
注释
这些OutputCacheProfile.VaryByParam设置是 VaryByParam 属性使用的相同设置。 不建议通过设置“*”的值来改变所有参数。 这可能会导致缓存溢出或 Web 服务器上的拒绝服务攻击。