O'Reilly logo

Learning ASP.NET 2.0 with AJAX by Dan Hurwitz, Jesse Liberty, Brian MacDonald

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Products Page

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, the GridView is made visible. When the user selects a product from the GridView, 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 drag a SqlDataSource control from the Data section of the Toolbox into the Content control 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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required