语言

OutputCacheProfile.VaryByCustom 属性

定义

获取或设置 VaryByCustom 属性。

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

属性值

值 VaryByCustom 。

属性

示例

下面的代码示例演示如何使用该 VaryByCustom 属性。


// Get the current VaryByCustom.
String varyByCustomValue = 
    outputCacheProfile.VaryByCustom;

// Set the VaryByCustom.
outputCacheProfile.VaryByCustom = 
    string.Empty;
  ' Get the current VaryByCustom.
  Dim varyByCustomValue As String = _
  outputCacheProfile.VaryByCustom

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

注解

VaryByCustom可以是表示自定义输出缓存要求的任何文本。 如果输入自定义字符串,则必须重写 GetVaryByCustomString 应用程序的 Global.asax 文件中的方法。

注释

这些VaryByCustom设置与指令的属性VaryByCustom使用的@ OutputCache设置相同。

适用于

另请参阅