3. RadioButton Control
- Radio Button control is used, when you want the user to
select only one option from the available choices.
- Radiobutton is used to allow user to select a single
radiobutton from group of radiobutton. In a asp.net
generally we use more than one radiobutton and select
only one radiobutton at a time from all the radiobutton
control.
4/6/2022 Mr.Omeed M. M 3
5. Important Properties of the Radio Button Control
Checked - This is a boolean property, that is used to check if the
button is checked or not.
Text - This is string property used to get or set the text associated
with the radio button control
TextAlign - right or left. On which side of the radio button the text
should appear
4/6/2022 Mr.Omeed M. M 5
6. Important Properties of the Radio Button Control
AutoPostBack - Set this property to true, if you want the webform to
be posted immediately when the checked status of the radio button
changes.
Group Name - By default, the individual radio button selections, are
not mutually exclusive. If you have a group of radio buttons, and if
you want the selections among the group to be mutually exclusive,
then use the same group name for all the radio button controls.
4/6/2022 Mr.Omeed M. M 6
7. Methods of a RadioButton Control:
Focus - Set input focus onto the control.
4/6/2022 Mr.Omeed M. M 7
8. Event of the Radio Button Control
CheckedChanged - This event is fired when the checked status of the
radio button control is changed
4/6/2022 Mr.Omeed M. M 8
9. How to add RadioButton?
< asp:RadioButtonID="RadioButton1" runat="server" Text="Male" GroupNa
me="gender"/>
or
We have a toolbox in ASP.NET so first we need to drag the given ‘radiobutton’
control in the web form from the toolbox
4/6/2022 Mr.Omeed M. M 9