Data Binding with Basic Web Forms Controls

Of the basic controls introduced in Chapter 15, five are frequently used for data binding:

  • BulletedList
  • CheckBoxList
  • DropDownList
  • ListBox
  • RadioButtonList

In Chapter 18, you saw how to populate the DropDownList control with a data source, and the other controls work in much the same way. What all these controls have in common is that you can use them to display data elements; they don't provide the ability to edit that data.

You use these controls to enrich the UI of your web application. You don't need to require the user to type in values when you can load them from a database, for example.

Listing 19-1 shows the markup for a page that contains all five of the data-bound controls and a LinqDataSource ...

Get Applied ASP.NET 4 in Context 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.