RadioButton Web Server Control
in ASP.NET environment,This article explains you how to work with RadioButton Web Control.ASP.NET provides two controls such as RadioButton and RadioButtonList.The RadioButton and RadioButtonList Web server controls provide a way for users to select exclusive options.
here, two Controls provide differnt functions and can be used to achive different purposes.The controls allow you to define any number of radio buttons with labels and to arrange them horizontally or vertically.
RadioButton Vs RadioButtonList
Individual RadioButton control to a page provides a single options to a page.for more options,we include more than one RadioButtons
In other hand, the RadioButtonList control is a single control that acts as a parent control for a collection of radio button list items.Therefore, many of the procedures for working with the RadioButtonList control are the same as they are for the other list Web server controls.
Grouping Radio Buttons
The following ways helps you to create grouped Radio Buttons
- Add individual RadioButton Web server controls to a page and then manually assign them all to a group. In this case, the group is an arbitrary name; all radio buttons with the same group name are considered part of a single group.
- Add a RadioButtonList Web server control to the page. The list items in the control are automatically grouped.
Radio Button Events
RadioButton controls perfomes a CheckedChanged event when users click the control. By default, this event does not cause the page to be posted to the server, but you can have the control force an immediate post by setting the AutoPostBack property to true