Chapter 8. Creating Custom Server Controls: Building an Online Store

In This Chapter:

  • Home Page

  • The Store Database

  • Server Controls

  • Product List Page

  • Product Detail Page

  • Review and Add Page

  • Search Results Page

  • Shopping Cart Page

This chapter features an application that was written by the developers at Microsoft. It's called The IBuySpy Store. This application is different from the IBuySpy application in Chapter 18 because that is a portal, not a store. An online store's primary purpose is to display and sell products, while a portal's main purpose is to organize and present information. This application, though, is chocked full of recommended practices that the Microsoft developers feel strongly about.

The IBuySpy Store was probably created when the Microsoft developers had been imbibing in too much Jolt cola. You can buy anything from a fake moustache translator to a pocket protector rocket pack. Its purpose, though, is to simulate a Web-based catalog sales application. The items are categorized, and users can browse through the items in each category. If they find something they like, they can add it to their shopping cart. When they've found everything they need to become the spy of their dreams, they can check out and pay for their items. Of course, the sales are not real, and no credit card transactions really occur.

If users don't want to browse through the items, they can search for something by typing in a keyword. They can even review the items, similar to writing those book reviews on Amazon. Just to show the proper techniques, the final order information is checked for an account number, an e-mail address, and a password.

For authenticated users, there's an "instant order" feature whereby orders can be placed and tracked. This mechanism is built into a Web Service that can be used from another application. This means that you could easily extend the ordering and tracking functionality to a third-party application. For more information about creating and using Web services, see Chapter 14.

The IBuySpy Store application is written in ASP.NET. It does, however, use several server controls, or components, such as the one that encapsulates the menus. The controls provide a way to easily reuse functionality from one page to another. A complete description of these server controls can be found in the section entitled "Server Controls."

The database engine used is SQL Server. All of the product information and transaction information is stored in the database. Most of the access is done through stored procedures, which are encapsulated in the reusable components that we've talked about. A complete discussion of the database can be found in the section entitled "The Store Database."

ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ASP. NET Solutions - 24 Case Studies. Best Practices for Developers
ISBN: 321159659
Year: 2003
Pages: 175 © 2008-2017.
If you may any questions please contact us: