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

속성 값

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

적용 대상