DevCity.NET -
ASP.NET 2.0 Website Programming
David Jeavons
I have been programming database applications for almost 12 years starting out with VB3 and using every major version since then. I currently work for a retailer analysis company writing ASP.NET code for our ever evolving web site. I also enjoy helping other programmers with Visual Basic and .NET and am a moderator at vbCity. 
by David Jeavons
Published on 8/2/2006

If you want to get up to speed with the majority of the new features offered by ASP.NET 2.0 then this is definitely one of the books that should be sitting on your bookshelf.

This book is aimed at those developers who already have a working knowledge of ASP.NET 1.x but does not require the developer to have knowledge of ASP.NET 2.0. The main goal of the book is to introduce the new features of ASP.NET 2.0, but unlike a standard reference book that will simply discuss each new control and all of its properties and methods the author has taken a different approach and has instead decided to introduce these new controls by building a fully functional website for a fictitious Pub. The website is called "TheBeerHouse" and incorporates such features as Newsletters, Opinion Polls, Forums and even an E-Commerce section among many other cool features. The website for this book can be viewed here.

The full title of this book is "ASP.NET 2.0 Website Programming, Problem - Design - Solution" and each chapter is laid out in three parts. The first part outlines the problem that will be overcome in the chapter, the second part discusses the design that will be implemented to overcome the problem and the third part implements the code discussed in the design section. I found that this format works really well, especially if you are relatively new to website programming as the author takes you through every detail that he himself faced when designing the website.   So, rather than simply saying which design he will implement, he discusses all of the possible designs that he may have implemented and goes through the pros and cons of each one before then detailing the reasons for choosing a particular design. This actually gives you a good understanding of the different options that you have available to you for various problems and the reasons why you may choose one over the other based on the scenario you face at the time.


The book is broken down into 12 chapters, each one dedicated to a particular section of "TheBeerHouse" website that you will create.

Chapter 1 - Introducing the Project: TheBeerHouse
This chapter takes you through the layout of the book and details the reasons for creating "TheBeerHouse" website.

Chapter 2 - Developing the Site Design
In this chapter you are taken through the creation of the basic "Look and Feel" of the site using Master Pages and Themes, including the ability to switch themes at runtime, allowing your visitors to personalise their view of the site. You will also create the navigation for the site using the new SiteMapPath and Menu controls.

Chapter 3 - Planning an Architecture
The main priority of this chapter is to lay down the framework that will be used for the site, including the Data Access and Business Logic layers. I found this chapter to be especially interesting as it discusses quite a few new technologies introduced by the .NET 2.0 Framework, including caching, and Health Monitoring. This chapter also has a small section dedicated to showing you some of the new controls in ASP.NET 2.0 in preparation for the remaining chapters, such as the GridView, DetailsView and FormsView controls. 

Chapter 4 - Membership and User Profiling
Handling users and roles was always a little cumbersome in ASP.NET 1.x sites, often requiring you to provide your own logic and techniques. ASP.NET 2.0 now provides intuitive controls and objects that handle this for you and makes the management of user accounts a breeze. By the end of this chapter, you will have used the CreateUserWizard control to create new user accounts and the Login and ChangePassword controls to authenticate and modify login details respectively. You will also be introduced to the new ASP.NET Web Site Administration Tool that helps you setup initial users and roles and other application specific features.

Chapter 5 - News and Article Management
No website will stand the test of time unless its content frequently changes. This section of the book teaches you how to implement a fully functional content management system allowing users to submit their own content ready for administrators and editors to approve. The system also allows for each article to have its own comments and ratings and adds methods for administrators and editors to remove comments should they be deemed offensive.

Chapter 6 - Opinion Polls
Continuing with the flow of keeping your users interested, this section shows you how to set up opinion polls to allow your users to express their views and really feel that they have something to offer to the website. The opinion polls are also available in the archives of the website, allowing new visitors to get a feel of what existing members think of the website and what is most important to them.

Chapter 7 - Newsletters
Another method of keeping users interested in the site is to keep them informed of new content and upcoming events. This section of the book implements a fully featured newsletter system that allows editors and administrators to set up a newsletter and send it out to those users that have opted to receive it. Not only does this chapter implement a fully featured newsletter system, it also teaches you how to use threads to process the sending of emails and to use client side callback scripts to notify the user of the progress while sending out the newsletters.

Chapter 8 - Forums
Yet another tool for giving users the feeling of community is to allow them to leave messages for other users or to ask questions regarding the site or upcoming events. Forums have long been the standard for allowing users to communicate with each other and this section details the implementation of such a system.

Chapter 9 - E-Commerce Store
If you are planning on generating any money from your site then you may well decide to sell certain products via your website. This chapter implements a fully functional E-Commerce store allowing users to browse the products on offer and to also read reviews from other users who have purchased the same products. The payment gateway used in this chapter is PayPal, so it would be very easy to take the techniques demonstrated and apply it to your own site using one of the industry's most common payment gateways.

Chapter 10 - Personalization and Web Parts
One of the new controls that first caught my eye when looking at the Beta version of ASP.NET 2.0 was Web Parts. Web Parts allows you to place content into different sections on the page and allow your users to either position them in a way that makes sense to them or to even hide them completely, giving them a truly personalised view on your site. In this chapter you will be introduced to the controls that allow you to implement Web Parts.

Chapter 11 - Localizing the Site
This section introduces you to the new localisation features of ASP.NET 2.0 to provide content in multiple languages and formats, based on each user's preferences.  With the introduction of strongly typed resource files, you will see how easy and intuitive it is to implement support for multiple languages for the site.

Chapter 12 - Deploying the Site
This final chapter takes you through a number of ways in which you can deploy your site from a simple X-Copy style deployment through to pre-compiling the site and even rolling out your own installer. This chapter also details how you can deploy the SQL Server Express database to a full SQL Server 2005 database.



The format of the book is well laid out and I especially like the Problem, Design and Solution pattern that has been implemented throughout the book. I also appreciate the views that the author has expressed throughout the book when detailing different design options as it gives you a much better understanding of what is available to you and when you should use one technique over another based on the particular scenario that you are faced with at the time.

For anybody looking to learn how to build web sites with ASP.NET 2.0, they will definitely find this book useful. The idea of introducing all of the new functionality of ASP.NET 2.0 while building a feature rich web site works really well and gives you an immediate understanding of the concepts introduced.

I personally didn't find anything that I didn't like about the book, but (there's always a but) some programmers may be put off by the fact that the book includes only C# code. I hope however, that those with no experience of C# still pick up this book as not only will you receive a greater understanding of web site development, you will also learn some C# code as well. I have only dabbled in C# but feel that I now understand the syntax a lot better after having tried out the various code samples throughout the book. It rather feels that I got two things for the price of one :)