Chapter 5. Building Web Applications

Within a short few years, ASP.NET has become a favorite tool of web applications developers and now, with the release of ASP.NET 2.0, it has undergone its second major upgrade. With ASP.NET 2.0, Microsoft has made major improvements based on feedback from its millions of customers as well as the company's own experience in developing and deploying web sites and portals. The rise of competing tools such as Macromedia Flash and open source PHP have also encouraged Microsoft to focus with particular intensity on improving the ease of use of ASP.NET while reducing the amount of code developers must write to create web applications.

For the Visual Basic 2005 programmer, the new release of ASP.NET is yet another bonanza, making web application development more accessible then ever to those with Visual Basic skills. Among its many improvements, ASP.NET 2.0 ships with dozens of new ready-to-use controls, considerably reducing the amount of code you need to write to achieve professional results. In fact, a stated aim of the Microsoft web development tools team is to reduce the amount of code you write to perform common web site tasks by up to 70%. In addition, ASP.NET 2.0 comes with some neat improvements, such as cross-page posting and the ability to insert client script into a page. You will learn about some of these features in this chapter.

The new features in ASP.NET 2.0 can be grouped into three broad categories: new controls and control functionality, improvements to the Page Framework, and new services and APIs.


ASP.NET 2.0 ships with more than 50 new controls that make the life of a web application developer easier by eliminating the need to write code. Specifically, there are new controls that help you to perform data access, site navigation, login, and personalization with Web Parts.

Page Framework

ASP.NET 2.0 supports some useful additions to its Page Framework, most importantly establishing a common look and feel on a site through a feature known as Master Pages. In addition to Master Pages, ASP.NET 2.0 supports "theming" through Themes and Skins, allowing you to maintain a consistent look and feel for your web sites and their controls. Another noteworthy feature in ASP.NET is its improved support for localization, which reduces the amount of work you need to do to internationalize your web applications.

Services and APIs

Behind the various new ASP.NET 2.0 controls for web site development lie the foundation services and APIs that do the heavy lifting the controls need to do their work. For example, behind the new Login controls you'll find the new Membership APIs, which perform such tasks as user authentication, registration of new users, etc. If the controls don't do what you need, you can make use of these APIs directly in code.

In this chapter, you will build a simple e-commerce web application using several of the most powerful and interesting features of Visual Studio 2005 and ASP.NET 2.0. The site will enable users whether or not they are authenticated to browse a list of books and add one or more to a shopping cart. Once a user is ready to checkout, the site will display a page asking the user either to log in or register as a new member and then proceed to log in as a new member.

As you build the site, you'll get a feel for the following Visual Studio 2005 and ASP.NET 2.0 features:

  • How to create a consistent look and feel for your web site using Master Pages

  • How to use the new Profiling services to save items into a shopping cart and keep track of them when a user registers and logs into the site

  • How to use the new security controls to create user accounts and to authenticate users

  • How to use new Member services to create a members-only directory of pages

  • How to display data using the GridView control

Of course, since this is a Visual Basic 2005 book, you'll also get to write some code. Figure 5-1 shows how the main page of application will look when it is completed. Users will click on the Add to Cart buttons to add items to their shopping cart and click on the Checkout button to go to the login page to sign in and make a purchase.

Figure 5-1. The completed shopping cart application

Visual Basic 2005 Jumpstart 2005
Visual Basic 2005 Jumpstart
ISBN: 059610071X
EAN: 2147483647
Year: 2005
Pages: 86
Authors: Wei-Meng Lee

Similar book on Amazon © 2008-2017.
If you may any questions please contact us: