The intent of the Products page is to allow the user to select a product category, and then see a grid displaying all the products in that category. The user can select any of these products to see more detail about that product, and if she wants, she can add that item to the shopping cart by clicking on a button.
This page has several data-bound controls: a
RadioButtonList for selecting the product category, a
GridView for displaying the products (filtered by
category), and a
DetailsView for displaying
details about the currently selected item.
In addition, visibility of some of the controls is turned off, depending on
circumstances. Initially, only the
RadioButtonList is visible. Once the user has selected a category,
GridView is made visible. When the user
selects a product from the
DetailsView and its associated button for adding the
item to the cart are made visible.
Open Products.aspx. You will start with a data source control
that will power all the other controls. Go to Source view, if not there already, and
SqlDataSource control from the Data
section of the Toolbox into the
on the page. Set the control's ID to
sqlCategories. Switch to Design view and click on the Smart Tag.
Configure it to point to the Adventure Works database—if you did the examples in
Chapter 4, you may still have a data
connection set up that refers to Adventure-Works.mdf. If not, you should probably
flip back to Chapter 4 and review the section on ...