Share via


Defining Device Filters

Use Visual Studio to define device filters. After the filter is defined, your application can apply it to one or more controls. The following steps explain how to declare the device filters that are stored in the Web.config file. (Delegate-based device filters that use a method defined in the code of an ASP.NET mobile Web page are not declared in the application's Web.config file.)

Procedures

To define a device filter

  1. Select the control to which the filter will be applied.

  2. In the Properties window, click the ellipsis button (ASP.NET Mobile Designer ellipse) in the AppliedDeviceFilters box.

    The Applied Device Filters Dialog Box is displayed.

  3. Click Edit.

    The Device Filter Editor dialog box is displayed.

  4. Create a new device filter by doing the following:

    1. Click New Device Filter.

    2. Enter the name for the new filter. Filter names are case sensitive.

    3. Select a Typeoption (for example, Equality Comparison) and specify values for the Compare and Argument text boxes. For more information about the Type option, see the Device-Specific Rendering topic.

  5. Use the arrow buttons to specify the order in which the device filters are saved in the Web.config file.

    Note

    Because these changes are saved in the Web.config file, they affect every page in your project. The order in which the filters appear in the Web.config file has no effect on functionality.

  6. Click OK.

See Also

Tasks

How to: Configure Device Filters

Concepts

Introduction to Device Filters

Applying Device Filters

Overriding Properties

Other Resources

Customizing ASP.NET Mobile Web Controls for Specific Devices

Customizing with Control Templates