Skip to main content

Asp.Net Radio Button

How to add RadioButton in Asp.Net ?
                            RadioButton allow to choose one  items from list of related items. To add radio button simply include <asp:RadioButton> tag in Asp page.
<div>
 <asp:RadioButtonList ID="ratiobutton1" runat ="server" >
             <asp:ListItem >85 to 100%</asp:ListItem>
<asp:ListItem Value ="1">70 to 84%</asp:ListItem> 
<asp:ListItem Value ="2">55 to 69%</asp:ListItem>
<asp:ListItem Value ="3">30 to 54%</asp:ListItem>
<asp:ListItem Value ="4">Below 30%</asp:ListItem>
         </asp:RadioButtonList> 
<div>
The subtag <asp:ListItem > will add radio option, the attribute Value add integer value, for our convenience to use in code behind page.  
In code behind page(Vb.Net)
ratiobutton1.SelectedItem.ToString() return selected ratio option  string value.
ratiobutton1.SelectedValue() return selected selected ratio option integer value.

 Thank You. Like, Share and Subscribe 👍 Followlect.com

Comments