Radio buttons represent a group of multiple options. Only one radio button in a group can be checked at a time.
Property | Description |
---|---|
Text | Gets or sets the text label of radio button. |
TextAlign | Determines how text label is aligned relative to radio button. Possible values are Left, and Right (default). |
AutoPostBack | If True, the form is automatically posted when a new radio button is selected from the group. |
Checked | Value is True if radio button is checked and False otherwise. |
GroupName | Specifies the name of the group that contains the radio buttons. |
Methods | Description |
OnCheckedChanged | Raises CheckedChanged event. |
Events | Description |
CheckedChanged | Raised when radio button changes from being checked to unchecked, or vice versa. |
You can group radio buttons using the GroupName property. There are two ways in which you can determine which radio button in a group is checked. Either check the Checked property of every control in the group or use the CheckedChanged event. CheckedChanged is much easier to use. But, this event is fired only if a new radio button is checked. If you submit the form with the default (already selected) radio button, then this event does not fire.
Output: