ASP.NET RadioButtonList Control.
Namespace: System.Web.UI.WebControls
Assembly: System.Web (in system.web.dll)
The ASP.NET RadioButtonList control is used to create a multiple selection of radio selection elements within a group. The group is rendered as a
HTML Table element, the radio buttons within the list are rendered as
HTML input element type radio and the text fields associated with the radio buttons are rendered as HTML label elements.
Working example.
Creating the ASP.NET RadioButtonList control
From the above example.
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem>DELL</asp:ListItem>
<asp:ListItem>HP Computers</asp:ListItem>
<asp:ListItem>SONY</asp:ListItem>
<asp:ListItem>ACER</asp:ListItem>
</asp:RadioButtonList>
The above example will be rendered as HTML with the result below (source).
<table id="ctl00_ContentPlaceHolder1_RadioButtonList1" border="0"> <tr> <td><input id="ctl00_ContentPlaceHolder1_RadioButtonList1_0" type="radio" name="ctl00$ContentPlaceHolder1$RadioButtonList1" value="DELL" /><label for="ctl00_ContentPlaceHolder1_RadioButtonList1_0">DELL</label></td> </tr><tr> <td><input id="ctl00_ContentPlaceHolder1_RadioButtonList1_1" type="radio" name="ctl00$ContentPlaceHolder1$RadioButtonList1" value="HP Computers" /><label for="ctl00_ContentPlaceHolder1_RadioButtonList1_1">HP Computers</label></td> </tr><tr> <td><input id="ctl00_ContentPlaceHolder1_RadioButtonList1_2" type="radio" name="ctl00$ContentPlaceHolder1$RadioButtonList1" value="SONY" /><label for="ctl00_ContentPlaceHolder1_RadioButtonList1_2">SONY</label></td> </tr><tr> <td><input id="ctl00_ContentPlaceHolder1_RadioButtonList1_3" type="radio" name="ctl00$ContentPlaceHolder1$RadioButtonList1" value="ACER" /><label for="ctl00_ContentPlaceHolder1_RadioButtonList1_3">ACER</label></td> </tr> </table>
|