Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Webmaster's Guide to the Wireless Internet part 42. The Webmaster’s Guide to the Wireless Internet provides the Wireless Webmaster with all of the tools necessary to build the next generation Internet. Packed with the essential information they need to design, develop, and secure robust, e-commerce enabled wireless Web sites. This book is written for advanced Webmasters who are experienced with conventional Web site design and are now faced with the challenge of creating sites that fit on the display of a Web enabled phone or PDA | 382 Chapter 9 Microsoft Mobile Internet Toolkit Figure 9.12 Viewing the Mobile Web Form on the Various Devices Let s now take a closer look at the Welcome.aspx page.The first few lines of a Mobile Web Form contains the standard header directives www.syngress.com Microsoft Mobile Internet Toolkit Chapter 9 383 @ Page Inherits System.Web.UI.MobileControls.MobilePage Language VB @ Register TagPrefix Mobile Namespace System.Web.UI.MobileControls Assembly System.Web.Mobile The @ Page directive defines page-specific attributes used by the ASP.NET page parser and compiler.The Inherits attribute specifies that the page is inherited from the System.Web.UI.MobileControls.MobilePage class which itself is inherited from the ASP.NET Page class.The Language attribute specifies the language to be used in the page. For our example we have used VB.NET.The @ Register directive associates aliases with namespaces and class names. In the preceding Mobile Web form we use the tagprefix of Mobile to associate with the System.Web.UI .MobileControls namespace.The assembly in which the namespace you are associating with tagprefix resides is specified in the assembly attribute. Next we have the Mobile Form element.This element acts as a container to group controls together logically. Mobile Form id FormOne runat server In our case we have a Mobile Label control which simply provides a label for text to be displayed. Mobile Label runat server Welcome to the Microsoft Mobile Internet Toolkit Mobile Label That s all there is to it As you can see during runtime when the form is requested the .NET runtime will automatically detect the type of devices requesting that page and perform a dynamic generation of the target markup languages. In our case the Pocket PC and IE 5.5 both receive HTML as shown in Figure 9.13 and the UP.SDK receives WML as shown in Figure 9.14 . Figure 9.13 HTML Receives by Pocket PC and IE 5.5 html body form id FormOne name FormOne method post action welcome.aspx __ufps .