16 February 2014

Check Boxes and Radio Buttons - Basic Web Controls

         A check box displays a single option that the user can either check or uncheck and radio buttons present a group of options from which the user can select just one option.
       To create a group of radio buttons, you specify the same name for the GroupName attribute of each radio button in the group. If more than one group is required in a single form specify a different group name for each group.
      If you want a check box or radio button to be selected when it's initially displayed, set its Checked attribute to true. If the Checked attribute is set for more than one radio button in a group, then only the last one will be selected.
Basic syntax for check box:
 <asp: check box Id="chkoption" runat="server"></asp:checkbox>
Basic syntax for radio button:
  <asp:radio button id="rbOption" runat="server"></asp:radio button>
Common Properties of the Check Boxes and Radio Buttons:
    Text           : The text displayed next to the check box and Radio button
    Checked      : Specifies whether it is selected or not ,default is false
    Group Name  : Name of the group the control belongs to 

No comments:

Post a Comment