PartialCachingAttribute.VaryByCustom 속성

정의

출력 캐시가 사용자 정의 컨트롤을 변경하는 데 사용하는 사용자 지정 문자열의 목록을 가져옵니다.

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

속성 값

String

사용자 지정 문자열의 목록입니다.

예제

다음 코드 예제에서는 생성자를 사용자 정의 컨트롤에 적용할 수 있는 방법을 PartialCachingAttribute(Int32, String, String, String) 보여 줍니다. 이 예제에서 생성자는 사용자 정의 컨트롤을 캐시할 수 있음을 나타내고 캐시 항목이 브라우저 유형 및 주 버전 번호에 종속되도록 지정하는 데 사용됩니다.

// Set the PartialCachingAttribute.Duration property to
// 20 seconds and the PartialCachingAttribute.VaryByCustom
// property to browser.
[PartialCaching(20, null, null, "browser")]
public partial class ctlSelect : UserControl
' Set the PartialCachingAttribute.Duration property to
' 20 seconds and the PartialCachingAttribute.VaryByCustom
' property to browser.
<PartialCaching(20, Nothing, Nothing, "browser")> _
Public Class ctlSelect
    Inherits UserControl

설명

이 속성에 대해 "브라우저"를 지정하면 브라우저 유형 및 주 버전 번호에 따라 사용자 컨트롤이 변경됩니다. 또한 이 속성을 사용하여 출력 캐시가 사용자 제어 응답에 따라 달라지는 값을 확장할 수도 있습니다.

적용 대상