HttpCacheVaryByParams.Item[String] 속성

정의

캐시가 지정된 HTTP 요청 매개 변수에 따라 달라지는지 여부를 나타내는 값을 가져오거나 설정합니다.

public:
 property bool default[System::String ^] { bool get(System::String ^ header); void set(System::String ^ header, bool value); };
public bool this[string header] { get; set; }
member this.Item(string) : bool with get, set
Default Public Property Item(header As String) As Boolean

매개 변수

header
String

사용자 지정 매개 변수의 이름입니다.

속성 값

Boolean

캐시가 지정된 매개 변수 값에 따라 달라지면 true입니다.

예외

header이(가) null인 경우

예제

다음 코드 예제에서는 인덱서와 연결된 개체에서 인덱서에 HttpCachePolicy 액세스하는 HttpResponse방법을 Item[] 보여 줍니다.

Response.Cache.SetExpires(DateTime.Now.AddSeconds(60));
Response.Cache.SetCacheability(HttpCacheability.Public);
Response.Cache.SetValidUntilExpires(false);
Response.Cache.VaryByParams["Category"] = true;

if (Response.Cache.VaryByParams["Category"])
{
   //...
}
Response.Cache.SetExpires(DateTime.Now.AddSeconds(60))
Response.Cache.SetCacheability(HttpCacheability.Public)
Response.Cache.SetValidUntilExpires(False)
Response.Cache.VaryByParams("Category") = True

If Response.Cache.VaryByParams("Category") Then
   '...
End If

설명

접근자(getter) Item[] 로 사용되는 경우 인덱서는 지정된 매개 변수의 값이 현재 매개 변수 컬렉션에 있는 경우 또는 컬렉션이 모든 매개 변수를 나타내는 *(별표)로 설정된 경우 반환 true 합니다.

변경자(setter) Item[] 로 사용되는 경우 인덱서는 지정된 헤더 true에 해당하는 매개 변수 컬렉션의 매개 변수 값을 설정합니다. 모든 매개 변수를 나타내는 값 *을 지정할 수 있습니다.

적용 대상

추가 정보