ASP.NET Mobile Controls


print this page

Books

Building Microsoft ASP.NET Applications for Mobile Devices, Second Edition

Return to Top

A comprehensive reference for developing mobile Web applications with ASP.NET Mobile Controls, which ships with Visual Studio .NET 2003

This update of a popular Microsoft Press title shows programmers how to use the Microsoft .NET Framework, ASP.NET, and Microsoft Visual Studio .NET 2003 to create powerful, next-generation applications that are available anywhere, on phones, Pocket PCs, and other mobile devices. With this title, programmers learn how to incorporate dynamic access to data with ADO.NET, plus how to deliver content from a single ASP.NET page to multiple client browsers on devices with limited display and input capabilities.

Author:Andy Wigley and Peter Roxburgh
Pub. Date:April 2003
Publisher:Microsoft Press
ISBN:0-7356-1914-X
Pages:720

 Sample Chapter
 Book Web site


Hands-On Labs

ASP.NET Mobile Controls Advanced Lab:
Building an eBooks Browser Application Using Advanced Techniques with the ASP.NET Mobile Controls

Return to Top

In this lab, you will learn how to build a mobile Web application using some of the more advanced features of the ASP.NET mobile controls.

During this lab you will build a mobile web application that allows users to browse a list of available eBooks from any mobile device, including cell phones, pagers and PDAs like the Pocket PC. The user can select eBooks from those available, so that the selected titles can be emailed to them (the emailing code on the server is not included in this lab). You will create a custom control that inherits from the ObjectList, but which extends it with additional capabilities. You will enhance the presentation of the data using Templates. You will finish by packaging your solution for installation on a target Web server.

This lab illustrates the extensibility of ASP.NET Mobile controls. It shows how easy it is to adapt the standard presentation using Templates and how easy it is to create custom controls that inherit from and extend the standard controls, without losing the ability run the application on multiple mobile devices using mark-up languages like WML, cHTML , HTML and XHTML. It also demonstrates how Visual Studio .NET makes it easy to package a solution for installation on a Web server.

Estimated time to complete this lab: 45 minutes

Exercises

  • Exercise 1: Writing the Welcome Page
    In this exercise, you will create the Welcome page for the application. You’ll display a welcome logo using the DynamicImageControl, which is a custom control available for download from http://www.asp.net that can dynamically render the appropriately formatted image for the client device. The DynamicImage control has been pre-installed on your computer for the purposes of this lab. You will add mobile controls to the Webform to allow the user to select the search criteria: by author, by book name, or by isdn using the Selection list control, and then to enter the search string.
  • Exercise 2: Displaying Fields from a DataSet Using the ObjectList Control
    In this exercise, you will use the tools in Visual Studio .NET 2003 to set up a connection to a database. You will write code to fetch a DataSet from a database, using the search criteria the user entered on the first form. You will use the graphical tools in Visual Studio .NET 2003 to select which fields from the data source to display.
  • Exercise 3: Improving the Customer Experience on the Pocket PC
    In this exercise, you will customise presentation of the list of items on the Pocket PC using the , and .
  • Exercise 4: Maintaining Interactivity in the Template
    In this exercise, you will embed a regular ASP.NET control into the in order to ensure that items in the list are selectable by the user. You will write event handler code to ensure that your application works in the same way with clients that get the templated rendering as for clients that receive the default rendering.
  • Exercise 5: Extending the Capabilities of the ObjectList Control
    In this exercise, you will create a new custom control that inherits from the ObjectList. The standard ObjectList does not support multiple selections. This control extends the ObjectList to support multiple selections; it allows users to select items, maintains a record of which items have been selected, and displays a visual cue in the initial item list that an item has been selected. You will create two Item Commands in code when the control is instantiated, to select and to deselect an item from the details view. You will code an event handler that executes when the user selects these Item Commands. Finally, you will add a property to the control that records the selected items and write code to set the Selected property of the selected items.

 Lab Manual
 Lab Files

ASP.NET Mobile Controls Intro Lab:
Building a Mobile Mortgage Calculator Using the ASP.NET Mobile Controls and an XML Web Service

Return to Top

During this lab you will build a mobile web application that will allow users to calculate their monthly mortgage payment from any mobile device, including cell phones, pagers and PDAs like the Pocket PC. The ASP.NET mobile controls extend ASP.NET and the Visual Studio .NET IDE to make it fast and easy to build mobile web applications using your desktop skills.

In this lab, you will learn how to create a mobile web form project using Visual Studio .NET, in addition you will consume an XML Web Service from your Mobile Front end and then you will test it with multiple device emulators. The XML Web Service has been pre-installed in your machine.

This lab illustrates how easy it is to build a single mobile Web application using ASP.NET, that will automatically adapt the display to target multiple mobile devices and mark-up languages like WML, cHTML and HTML.

Estimated time to complete this lab: 45 minutes

Objectives

After completing this lab, you will be able to:

  • Use ASP.NET, Visual Studio .NET and the ASP.NET mobile controls to build a mobile presentation layer that targets multiple devices.
  • Consume XML Web Services in your mobile web application.
  • Validate user input and provide customized error messages
  • Customize your application for specific devices using PropertyOverride
  • Preview your mobile Web application in device emulators.

Exercises

  • Exercise 1: Creating a Mobile Web Application
    In this exercise, you will create a Mobile Web Application using Visual Studio .NET and the ASP.NET mobile controls.
  • Exercise 2: Registering the XML Web Service in the Mobile Application
    In this exercise you will register the XML Web Services in your mobile application that you can access this functionality later in the lab. This XML web Services requires three input parameters: Loan_Amount, Number_Months, and Interest_Rate. This XML Web Service has been pre-installed and is running on your local machine for this lab, however it could potentially be running on any server in the internet.
  • Exercise 3: Building the Mobile User Interface for the Web Service
    This step will use the ASP.NET mobile controls to build the mobile presentation layer that will automatically render to cell phones, PDAs and pagers. This user interface will gather the mortgage parameters and return the monthly payment information; it will have two forms, one to gather the customer information and the other will display the result to the users. The first form will have one label and a textbox to enter the loan amount, one label and a text box to enter the interest rate, and a label and selection list to select the number of year for the loan. The second form needs only a label to display the results and a link so a user could make a new calculation
  • Exercise 4: Adding Event Logic to Make the XML Web Services Call
    This step in the exercise adds the event logic to the Command control that will call the XML Web Services. This code will also change the label text on the result form based on the query executed by the XML Web Service
  • Exercise 5: Testing Your Application on Multiple Devices
    This exercise will test your application using multiple device emulators. This demonstrates how the ASP.NET mobile controls generate the correct rendering and mark-up language for the different devices from the same page and URL.

 Setup Document
 Lab Manual
 Lab Files

Building a Mobile Application using Microsoft Mobile Internet Toolkit, XML Web Services and Visual Studio .NET – Visual Basic .NET version

Return to Top

Time: 45 minutes

During this lab you will build a mobile web application in Visual Basic .NET that will allow users to calculate two numbers from any mobile device, including cell phones, pagers and PDAs like the Pocket PC. The Microsoft Mobile Internet Toolkit extends ASP.NET and the Visual Studio .NET IDE to make it fast and easy to build mobile web applications using your desktop skills. In this lab, you will also learn how to create a mobile web form project using Visual Studio .NET, in addition you will consume an XML Web Service (written in C#) from your Mobile Front end and then you will test it with a device emulators. The XML Web Service has been pre-installed in your machine. This lab illustrates how easy it is to build a single mobile Web application using ASP.NET that will automatically adapt the display to target multiple mobile devices and mark-up languages like WML, cHTML and HTML.

 Lab file
 Prerequisites
 General Instructions


© 2001-2003 Microsoft Corporation. All rights reserved. Terms of Use.