Freigeben über


Device Filter Editor Dialog Box

Use the Device Filter Editor dialog box to add to or edit the device filters defined in your site's Web.config file.

Hinweis

Making changes to the filters defined in this dialog box will affect every control that uses these filters on every mobile Web page in your site.

To access this dialog box

  1. In Visual Studio, open or create a Mobile Web Form.

  2. Switch to Design view.

  3. From the Mobile Web Forms tab of the Toolbox, drag a control into the mobile form box on the page.

  4. In the Properties window, select (AppliedDeviceFilters), and then click the ellipsis button (ASP.NET Mobile Designer ellipse) next to it.

    The Applied Device Filters dialog box is displayed.

  5. Click Edit.

Tasks

UI Elements

  • Device Filters
    Displays the existing device filters. To rename a device filter, click its name, press the F2 key, enter the new name.

    Hinweis

    The order of the filters on this list determines how they are stored in the Web.config file, and does not determine how the filters are applied during run time.

    Button

    Name

    What it does

    Move Upward Button

    Up Arrow

    Moves the selected item up one place in the list.

    Down Arrow Button

    Down Arrow

    Moves the selected item down one place in the list.

    DeleteButton screenshot

    Delete

    Deletes the currently selected item.

  • New Device Filter
    Click to add a device filter to the list.

Type

  • Equality Comparison
    Select to define a filter that compares a device capability against a constant value.

  • Evaluator Delegate
    Select to define a filter that performs a more complex evaluation than equality comparison. For example, the evaluation could be based on multiple device capabilities. To use this option, you must write a class with a static method that performs the evaluation. For more information, see Device-Specific Rendering.

Attributes

  • Compare
    Enter or select the capability that you want to use for comparison. (This option is available only if you have selected Equality Comparison.)

  • Argument
    Enter a value to compare to the current device capability. If they are equal, the device filter evaluates to true. (This option is available only if you have selected Equality Comparison.)

  • Type
    Enter a fully qualified type name that supplies the evaluator delegate. (This option is available only if you have selected Evaluator Delegate.)

  • Method
    Enter the name of the method that performs the comparison. (This option is available only if you have selected Evaluator Delegate.)

    The method must be declared as static (in C#), or Shared in Visual Basic, and must have the following signature.

    public static bool EvaluatorMethod(
        System.Web.Mobile.MobileCapabilities capabilities, 
        String compareArgument);
    
    Public Shared Function EvaluatorMethod(
        capabilities as System.Web.Mobile.MobileCapabilities, 
        compareArgument as String) as Boolean
    

See Also

Reference

System.Web.UI.MobileControls.Form

System.Web.UI.MobileControls.Panel

System.Web.UI.MobileControls.DeviceSpecific

Applied Device Filters Dialog Box

Concepts

ASP.NET Device Filtering Overview

Overriding Properties

Device Filtering Recommendations

Other Resources

Developing Adapters for ASP.NET Server Controls

ASP.NET Web Sites for Mobile Devices

Using Device Filters

Customizing with Control Templates