deviceFilters 요소(ASP.NET 설정 스키마)

[이 설명서는 미리 보기 전용이며, 이후 릴리스에서 변경될 수 있습니다. 비어 있는 항목은 자리 표시자로 포함됩니다.]

사용자 에이전트나 브라우저를 기준으로 ASP.NET MobileCapabilities 시스템에 있는 장치 또는 장치 클래스를 지정합니다. 페이지 또는 응용 프로그램 개발자는 장치 필터를 사용하여 컨트롤 속성을 재정의하거나 레이아웃 및 모양이 변경되는 콘텐츠 블록 또는 템플릿을 정의할 수 있습니다.

<deviceFilters>
     <filter.../>
</deviceFilters>

특성 및 요소

다음 단원에서는 특성, 자식 요소 및 부모 요소에 대해 설명합니다.

특성

없음

자식 요소

요소

설명

filter

선택적 요소입니다.

MobileCapabilities 클래스에 필터링 기능을 제공합니다. <deviceFilters> 섹션에 filter 요소가 한 개 이상 있을 수 있습니다.

부모 요소

요소

설명

configuration

공용 언어 런타임 및 .NET Framework 응용 프로그램에서 사용하는 모든 구성 파일의 필수 루트 요소입니다.

system.web

구성 파일에 있는 ASP.NET 구성 설정의 루트 요소를 지정합니다. ASP.NET 웹 응용 프로그램을 구성하고 응용 프로그램의 동작 방식을 제어하는 요소를 포함합니다.

설명

두 가지 형식의 장치 필터, 즉 비교 평가기와 평가기 대리자 중에서 선택할 수 있습니다.

기능 이름 및 비교할 대상 값을 제공하여 비교 기반 필터를 지정하면 간단한 비교를 수행할 수 있습니다. 기능 값과 제공된 값이 동일하면 런타임에 장치 필터가 true로 평가됩니다. 부울 속성을 비교할 때는 대/소문자가 구분되지 않으므로 true와 True는 모두 유효합니다. 다른 속성을 비교할 때는 대/소문자가 구분됩니다.

클래스 및 메서드 이름을 제공하여 평가기 대리자 기반 필터를 지정하면 더 복잡한 평가를 수행할 수 있습니다. 제공된 메서드는 런타임에 호출되어 장치 필터가 true인지 여부를 확인합니다.

기본 구성

다음의 기본 <deviceFilters> 요소는 컴퓨터 구성 파일이나 루트 Web.config 파일에 명시적으로 구성되어 있지는 않지만 .NET Framework 버전 2.0의 응용 프로그램에서 반환하는 기본 구성입니다.

<deviceFilters>
    <filter name="isJPhone" compare="Type" argument="J-Phone"/>
    <filter name="isHTML32" compare="PreferredRenderingType" argument="html32"/>
    <filter name="isWML11" compare="PreferredRenderingType" argument="wml11"/>
    <filter name="isCHTML10" compare="PreferredRenderingType" argument="chtml10"/>
    <filter name="isGoAmerica" compare="Browser" argument="Go.Web"/>
    <filter name="isMME" compare="Browser" argument="Microsoft Mobile Explorer"/>
    <filter name="isMyPalm" compare="Browser" argument="MyPalm"/>
    <filter name="isPocketIE" compare="Browser" argument="Pocket IE"/>
    <filter name="isUP3x" compare="Type" argument="Phone.com 3.x Browser"/>
    <filter name="isUP4x" compare="Type" argument="Phone.com 4.x Browser"/>
    <filter name="isEricssonR380" compare="Type" argument="Ericsson R380"/>
    <filter name="isNokia7110" compare="Type" argument="Nokia 7110"/>
    <filter name="prefersGIF" compare="PreferredImageMIME" argument="image/gif"/>
    <filter name="prefersWBMP" compare="PreferredImageMIME" argument="image/vnd.wap.wbmp"/>
    <filter name="supportsColor" compare="IsColor" argument="true"/>
    <filter name="supportsCookies" compare="Cookies" argument="true"/>
    <filter name="supportsJavaScript" compare="Javascript" argument="true"/>
    <filter name="supportsVoiceCalls" compare="CanInitiateVoiceCall" argument="true"/>
</deviceFilters>

예제

다음 예제에서는 비교 필터와 평가기 대리자 필터를 모두 구성합니다.

<deviceFilters>
  <filter name="IsHtml" 
    compare="PreferredRendering" 
    argument="html32" />
  <filter name="IsGPSEnabled" 
    type="MyApplication.MyCapabilityEvaluators,MyApplication" 
    method="IsGPSEnabled" />
</deviceFilters>

요소 정보

Configuration Section Handler

System.Web.Mobile.DeviceFiltersSection

Configuration Member

SystemWebSectionGroup.DeviceFilters

Configurable Locations

Machine.config

루트 수준의 Web.config

응용 프로그램 수준의 Web.config

Web.config

Requirements

IIS 5.0, IIS 5.1 또는 IIS 6.0

.NET Framework 1.1 또는 2.0

Visual Studio 2003 또는 Visual Studio 2005

참고 항목

작업

How to: Configure Specific Folders Using Location Settings

How to: Lock ASP.NET Configuration Settings

참조

system.web 요소(ASP.NET 설정 스키마)

configuration 요소(일반 설정 스키마)

deviceFilters에 대한 filter 요소(ASP.NET 설정 스키마)

mobileControls 요소(ASP.NET 설정 스키마)

MobileCapabilities

System.Configuration

System.Web.Configuration

개념

ASP.NET Configuration File Hierarchy

Securing Configuration

Configuration Inheritance

기타 리소스

Using Device Filters

ASP.NET Mobile Web Pages

Creating ASP.NET Mobile Web Applications

일반 구성 설정(ASP.NET)

ASP.NET 구성 설정

Configuring ASP.NET Applications

ASP.NET Configuration Files

ASP.NET Configuration API