how to set required field validation control to the radio button
how to set required field validation control to the radio button
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
nallyaPosted Sep 21, 2012, 1:44 AM
To use the RequiredFieldValidator for radion button in ASP.NET you must use the RadioButtonList control. It is not possible to do it with the normal radion button.
Sukesh MarlaPosted Sep 21, 2012, 2:52 AM
Check my article on Validation control
http://www.c-sharpcorner.com/UploadFile/SukeshMarla/Asp-Net-validation-control/
let me know if have any confusion
Gopi ShankarPosted Sep 21, 2012, 1:34 AM
nallyaPosted Sep 18, 2012, 3:13 AM
1. First add the RadioButtonList control to your page.
2. Now add the RequireFieldValidator to your page. Make sure you set the ControlToValidate property to the ID of the RadioButtonList.
3. Set all the other proporties of the two control as required.
EXAMPLES:
<tr>
<td>
Would you like to continue?
<br />
td>
<td class="style1">
<asp:RadioButtonList ID="rdlYesNo" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Text="Yes" Value="Yes">asp:ListItem>
<asp:ListItem Text="No" Value="No">asp:ListItem>
asp:RadioButtonList>
<asp:RequiredFieldValidator ID="rfvrdlYesNo" runat="server" ControlToValidate="rdlYesNo"
Display="Dynamic" ErrorMessage="Would you like to continue? is required."
ValidationGroup="InflightProfile">*asp:RequiredFieldValidator>
td>
tr>
<tr>