共用方式為


Overriding Properties 

ASP.NET mobile Web pages can customize the property values of their controls based on the capabilities of the requesting device. For example, in your application, you might use a Label control to display long text on one set of devices and abbreviated text on another. Each control provides a set of properties that the application can override on a per-device basis.

To override particular properties of a control, you must first define device filters. Apply the device filters to the control to specify the set of devices for which you want to define custom property values. Property override values can be edited only for the current device filter. Therefore, you must select the filter that you want to use to override property values, and set it as the current filter. After you select the device filter, you set the property override values for that filter. To set property override values for additional filters, select each filter in turn and specify the custom property values for that filter.

Procedures

To define property override values

  1. Select the control whose property values you want to override for specific types of devices.

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

    The Property Overrides dialog box is displayed.

  3. If there are no device filters defined, do the following:

    1. Click Edit. The Applied Device Filters dialog box is displayed.

    2. In the Applied Device Filters dialog box, click Edit to display the Device Filter Editor dialog box.

    3. Define one or more device filters for the control.

  4. If device filters are defined but not currently applied, apply device filters by doing the following:

    1. Click Edit, which displays the Applied Device Filters dialog box.

    2. Apply one or more device filters to the control.

  5. In the Applied Device Filters list, select the device filter for which you want to define property overrides.

  6. In the Device-Specific Properties list, define the property values associated with the selected applied device filter.

See Also

Tasks

Walkthrough: Customizing ASP.NET Mobile Web Pages for Specific Devices

Reference

Property Overrides Dialog Box

Other Resources

Customizing ASP.NET Mobile Web Controls for Specific Devices