How to: Add RadioButtonList Web Server Controls to a Web Forms Page
When you use a RadioButtonList control, you add a single control to the page. Adding items to the control is a separate process that depends on whether you will display a static list in the control or a list generated dynamically at run time.
Note |
|---|
|
The procedure for working with individual RadioButton Web server controls is different. For details, see How to: Add Individual RadioButton Web Server Controls to a Web Forms Page. |
To add a RadioButtonList control to a Web Forms page
-
Type an <asp:RadioButtonList> element onto the page. For syntax, see RadioButtonList Web Server Control.
-
Optionally, change the orientation of the caption by setting the TextAlign property.
-
Optionally, change the layout of the control to display multiple columns. For details, see How to: Set Layout in a RadioButtonList Web Server Control.
-
Create items for the control in one of these ways:
-
By creating them as individual items. For details, see How to: Add Items in List Web Server Controls.
-
By data-binding the control. For details, see How to: Populate List Web Server Controls from a Data Source.
-
Note