Delete the default.aspx
and web.config files that are automatically created. Right-click the project, and select Add ??¤
New Item followed by Mobile Web Configuration File. This adds a web.config that has a bunch
of device filters defined. Perform the same step to select to add a Mobile Web Form or Mobile
Web User Control.
In the next section, we provide an overview of the mobile controls available in ASP.NET.
Mobile Controls Quick Primer
ASP.NET mobile web applications are created using a descendent of the Page. The MobilePage
class inherits from System.Web.UI.Page. After downloading the templates described in the
previous section, a Mobile Web Form item is available in Visual Studio in the My Templates
section in the Add New Item dialog shown in Figure 10-9.
Figure 10-9. The mobile web items in the Add New Item dialog under My Templates
484 CHAPTER 10 ?– OTHER SERVER CONTROLS
This new MobilePage web page class is necessary because of how .aspx pages are constructed
to support mobile development. The differences that spring to mind when comparing a regular
ASP.NET web form with a mobile web form are that mobile application namespaces and tag
prefixes are brought in by the topmost Register directive. The controls and the mobile web
form import from the System.
Pages:
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622