共用方式為


How to: Add and Configure a DeviceSpecific Control 

Use a DeviceSpecific control to enable the standard device-specific features built into container controls. Adding this control to a Form or Panel control enables you to use property overrides and templates with forms or panels. (Other types of controls do not use the DeviceSpecific control to enable these features.)

To add a DeviceSpecific control to a container control

  1. In Visual Studio, drag a DeviceSpecific control from the Mobile Web Forms tab of the Toolbox onto a Form or Panel control onto an ASP.NET mobile Web page.

  2. Right-click the DeviceSpecific control, and then click Templating Options on the shortcut menu.

  3. In the Templating Options dialog box, select a device filter.

  4. To add a template, right-click the DeviceSpecific control, click Edit Template in the shortcut menu, and then click Header and Footer Templates (for Form controls) or Content Template (for Panel controls).

  5. To override the property values, select the DeviceSpecific control and then in the Properties window, click the ellipsis button (ASP.NET Mobile Designer ellipse) in the PropertyOverrides box.

See Also

Concepts

Introduction to the DeviceSpecific Control
DeviceSpecific Element
Defining Device Filters
Introduction to the Form Control
Introduction to the Panel Control

Other Resources

Customizing with Control Templates