Using the RadioButtonList Web Control

In the previous section we saw how to bind database data to a DropDownList Web control.

Along with being able to bind data to a DropDownList, database data can also be bound to a list of radio buttons and a list of checkboxes. In Hour 11 we examined the CheckBox and RadioButton Web controls, which could be used to create a single checkbox or radio button, respectively.

In Hour 11 we had to add a RadioButton Web control for each radio button we wanted to add to the page. While this approach works for situations where we know precisely the number of radio buttons we want on the page, it doesn't work when we need a variable number of radio buttons. For example, we could redo the example we examined in the previous ...

Get SAMS Teach Yourself ASP.NET in 24 Hours now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.