18.5. Updating a Web Page to Add Profile Data

In the preceding section, you created the plumbing that adds, removes, and updates a shopping cart. The ASP.NET Profile object takes care of storing each user's shopping cart in the database.

The great thing about adding a shopping cart to Microsoft's code (that is, the Small Business Starter Kit) is that Microsoft did the design work. In this section, you find a spot to insert a LinkButton control that adds an item to the user's shopping cart.

18.5.1. Inserting a LinkButton into the page

It can be tricky to update a page without messing up an existing layout. Follow these instructions to add the LinkButton markup with a minimum of collateral damage:

  1. In the Small Business Starter Kit project, open Items.aspx.

  2. In Design view, near the bottom of the page, locate the GridView control with the ID of GridViewItems. (Be careful because there's also a GridViewCategories that you don't want to disturb.)

  3. From the GridView control's Tasks menu, choose Edit Templates.

    The ItemTemplate template appears, as shown in Figure 18-4.

    Figure 18-4. Editing the ItemTemplate in GridViewItems.
  4. Insert the cursor to the right of the Read More hyperlink and type a space, a pipe character (|), and another space. Leave the cursor where it is.

  5. In the Standard category of the Toolbox, double-click a LinkButton control to insert the control at the cursor location.

Get ASP.NET 3.5 For Dummies® now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.