Exam 70-553 - Create a mobile Web application project.

Section 2
  • Part 7
    Creating ASP.NET Mobile Web Applications
    • Topic 1
Create a mobile Web application project.
  • Use device-specific rendering to display controls on a variety of devices.
  • Use adaptive rendering to modify the appearance of Web server controls.
  • Use the mobile Web controls to display content on a device.

Summary

To use device specific rendering you must set up filters in your web config or machine config that define what device capabilities you are looking to target. Then you can use DeviceSpecific Control in your code to specify which value to use. In the example taken from the resources, a mobile image control has different values for ImageUrl depending on the device:

<mobile:Image runat=server >
<DeviceSpecific>
<Choice Filter="IsHtml" ImageURL="Logo.gif" />
<Choice Filter="IsWbmp" ImageURL="Logo.wbmp"/>
<Choice ImageURL="Logo.bmp"/>
</DeviceSpecific>
</mobile:Image> In the Web Config:
<configuration>
<system.web>
<deviceFilters>
<filter name="IsHtml" compare="PreferredRenderingType" argument="html32" />
<filter name="IsWbmp" compare="PreferredImageMime" argument="image/vnd.wap.wbmp" />
</deviceFilters>
</system.web>
</configuration>

The process of creating different markup and layout for different devices is known as adaptive rendering. In ASP.Net most controls have this capability built in so you can use all web controls and they will render correctly on any type of device.

The controls that ship with ASP.Net 2.0 and are mobile ready include Container Controls that include Form and Panel Controls, Standard Controls that include AdRotator, Calendar, Label, Textbox, TextView, Command, Image, PhoneCall, and Link Controls, and List Controls that include List, ObjectList, and SelectionList Control, and ValidationControls that include CompareValidator, CustomValidator, RangeValidator, RegularExpressioValidator, RequiredFieldValidator and ValidationSummary Controls and special controls like the DeviceSpecific Control mentioned earlier and a Stylesheet Control.

Other Resources & Links:

Device Specific Rendering
http://msdn2.microsoft.com/en-us/library/hkx121s4.aspx

Mobile Magic: Device Specific Rendering – Device Specific Control
http://www.dotnetforce.com/Content.aspx?t=a&n=244

A Look at ASP.NET's Adaptive Rendering
http://aspnet.4guysfromrolla.com/articles/050504-1.aspx

Using ASP.Net Mobile Controls in the designer
http://msdn2.microsoft.com/en-us/library/ccteh924.aspx

Exam 70-553 - Manage control layout on a Windows Form.

Exam 70-553 - Use login controls to control access to a Web application.