Skip to Content
ASP.NET 3.5 For Dummies®
book

ASP.NET 3.5 For Dummies®

by Ken Cox
February 2008
Intermediate to advanced
428 pages
8h 52m
English
For Dummies
Content preview from ASP.NET 3.5 For Dummies®

4.3. Introducing the FormView Control

The preceding sections of this chapter demonstrate the easy implementation of RUD (Retrieve, Update, Delete), using the GridView control. For the adding (Creating in CRUD-parlance) part of the acronym, you use ASP.NET's FormView control.

Oh, and have you written any code yet? Keep it that way!

4.3.1. Adding a FormView control to the page

The FormView control lets you display, update, and add data via drag and drop. In this procedure, you only need the FormView control's ability to insert (that is, add) a row. Remember: You're still working on the ASP.NET page that you added in Chapter 3.

Follow these steps to add a FormView control to the page and set its data source:

  1. From the Toolbox, in the Data category, drag a FormView control and drop it below the existing GridView control.

  2. Click the Smart Tasks arrow thingy to open the FormView control's Tasks menu.

  3. Choose a data source (usually, SqlDataSource1) from the drop-down list, as shown in Figure 4-7.

Figure 4-7. Choosing the source of data for the FormView control.

As configured, the FormView control does more than you need on this page, such as displaying and updating DVD data. In the following section, you strip out the unwanted functions by digging into the FormView control's templates.

4.3.2. Changing the FormView control's templates

The FormView control is a shape-shifter in that it can ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

ASP.NET 3.5 Unleashed

ASP.NET 3.5 Unleashed

Stephen Walther
ASP.NET 4 Unleashed

ASP.NET 4 Unleashed

Stephen Walther, Kevin Hoffman, Nate Dudek

Publisher Resources

ISBN: 9780470195925Purchase book