asp.net.ph

RadioButton.GroupName Property

System.Web.UI.WebControls Namespace   RadioButton Class


Sets or retrieves the name of the group that the radio button belongs to.

Syntax


Inline <asp:radiobutton groupname = strName ... >
Script RadioButton.GroupName [ = strName ]

Property Value


strName String specifying The name of the group that the radio button belongs to.

The property is read/write with no default value.

Remarks

Use the GroupName property to specify a grouping of radio buttons to create a mutually exclusive set of controls. The property can be used when only one selection is possible from a list of available options, as in the case of gender.

When this property is set, only one RadioButton in the specified group can be selected at a time.

Example

The following example illustrates how to set the GroupName property of radio button controls at design time.

<h5>The first president of the United States was:</h5>

   <table>
   <tr><td>
      <asp:RadioButton id = "Radio1" Text = "Abraham Lincoln" 
         GroupName = "choices" runat = "server" /><br>
      <asp:RadioButton id = "Radio2" Text = "Christopher Columbus" 
         GroupName = "choices" runat = "server" /><br>
      <asp:RadioButton id = "Radio3" Text = "George Washington" 
         GroupName = "choices" runat = "server" /><br>
      <asp:RadioButton id = "Radio4" Text = "Robert Plant" 
         GroupName = "choices" runat = "server" /><br>
   </td></tr>
   </table>

   <p><asp:button text = "Submit" onClick = "chkAnswer" runat = "server" />

 Show me 

See Also

RadioButton Members Skip Navigation Links




Home
Suggested Reading


Previous page Back to top Next page

© 2000-2010 Rey Nuñez All rights reserved.

If you have any question, comment or suggestion
about this site, please send us a note

You can help support asp.net.ph