Applying Device Filters
After you define a device filter, you can add it to the list of applied filters for a control. Applying filters to controls enables the use of property override values and templates.
To apply a device filter
Select the control to which the filter will be applied.
In the Properties window, click the ellipsis button () in the AppliedDeviceFilters box.
The Applied Device Filters dialog box is displayed. The Available Device Filters lists includes all the device filters defined at the application level.
Do one of the following:
Select a device filter that you want to use.
Enter the name of an evaluator-delegate method defined in the ASP.NET mobile Web page.
Click Add To List.
The selected device filter or method name is added to the Applied Device Filters list.
In the Applied Device Filters list, click the new device filter.
In the Argument box, enter any optional device filter argument. For comparison filters, the argument replaces the value defined in the Device Filter Editor dialog box and saved in the Web.config file. For delegate-based filters, the argument is passed to the method. If no argument is specified, a null value is used.
Nota
ASP.NET mobile controls distinguish device filters by using both the name and argument value of each filter. As a result, two device filters can have the same name if they have different argument values.
If required, reorder the applied device filters using the arrow buttons.
At run time, the application tests the filters one by one from the top to the bottom. The first device filter that results in a successful evaluation determines which property overrides or templates the application uses.
Nota
The applied device filter named Default always results in a successful evaluation. If present, this filter blocks all other evaluations below it in the list. This filter therefore appears as the last device filter in the Applied Device Filters list. Applications can use the Default filter to catch every device not matching any of the filters above it in the list.
Click OK.
See Also
Tasks
How to: Configure Device Filters
Concepts
Introduction to Device Filters
Other Resources
Customizing ASP.NET Mobile Web Controls for Specific Devices