Develop Mobile Solutions Using ASP.NET Mobile Controls

Develop Mobile Solutions Using ASP.NET Mobile ControlsIam totally impressed with the .NET Framework and the .NET integrated development environment (IDE). Using the MMIT toolkit and .NET IDE, I put together this example in less than 2 hours! Like many of you, I was a little intimidated by developing mobile solutions. I wasn’t sure what technology solution to use. I was confused because you have to know a lot of things to develop a mobile solution.


I’ve chosen a simple, but practical example for this article. It mimics a typical automatic teller machine (ATM) with no transaction capabilities. The purpose of this example is to show an account balance on a wireless mobile device. It validates the user name and password, and then accesses checking, savings, or credit line balance from a SQL Server database. Figure 1 shows the example’s data model. Please note that the purpose of this article isn’t to explore data models; thus, I’ve over-simplified the data model tremendously. You’re welcome to use complex data models. The article’s technique will still work.

Figure 2 shows how the IDE lets you drag and drop mobile Web forms to produce the user interface you want to create (listing 1). To recreate the example shown in this article, follow these steps:
1. In VS.NET, start a new Mobile Web Application project.
2. VS.NET will auto-generate a series of files and source code within them. Among the most important ones are MobileWebForm1.aspx and MobileWebForm1.vb (figure 2).
3. All the mobile Web form controls will be contained in the .aspx file. The example in this article contains three forms: frmLogin, frmAccountView, and frmResults.
4. Using the Mobile Web Form tab within the toolbox, drag and drop the Form, TextBox, Label, and Button controls (figure 2). The names of these controls will be self-explanatory when I explain the source code.
5. Within the IDE, tab over to MobileWebForm1.vb and cut and paste code from listing 1. I’ll explain the code in the next section. ASP.NET mobile controls provide applications with the ability to interface easily with databases. This technique is called data binding. Data binding takes advantage of the power of Microsoft ADO.NET DataSet, DataTable, and DataReader objects. DataSet, DataTable, and DataReader objects enable mobile Web Forms applications to connect seamlessly to databases, which reside locally or on a server. I use the data reader technique in listing 1 to access a user name based on login and password. I’m also using a data-binding technique to access various account balances. The mobile Web Forms page framework provides a flexible means of binding controls to information in a data store, as shown in listing 1. Data binding is really cool in ASP.NET mobile controls.

Website: www.afs-link.com | Filesize: 510kb
No of Page(s): 4
Click here to download Develop Mobile Solutions Using ASP.NET Mobile Controls.

Related Tutorial

Tags: , , ,

Comments

Leave a Reply