Language

PartialCachingAttribute.VaryByControls プロパティ

定義

出力キャッシュがユーザー コントロールを変更するために使用するユーザー コントロール プロパティの一覧を取得します。

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

プロパティ値

ユーザー コントロールのプロパティの一覧。

例

次のコード例は、 PartialCachingAttribute(Int32, String, String, String) コンストラクターをユーザー コントロールに適用する方法を示しています。 この例では、コンストラクターを使用して、ユーザー コントロールをキャッシュできることを示し、キャッシュ期間を 20 秒として指定し、ユーザー コントロールの出力を変更する state という名前のコントロールを指定します。

// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByControls
// property to the ID of the server control to vary the output by.
// In this case, it is state, the ID assigned to a DropDownList
// server control.
[PartialCaching(20, null, "state", null)]
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByControls
' property to the ID of the server control to vary the output by.
' In this case, it is state, the ID assigned to a DropDownList
' server control.
<PartialCaching(20, Nothing, "state", Nothing)> _
Public Class ctlSelect
    Inherits UserControl

適用対象