RadioButton validation


Copy the following code and paste in your aspx page and run it….

——————————————————————————————–

<asp:RadioButtonList ID=”RadioButtonList1″ runat=”server” Height=”26px”

RepeatDirection=”Horizontal” style=”font-weight: 700; color: #FF0000″  Width=”91px”> <asp:ListItem>Male</asp:ListItem>

<asp:ListItem>Female</asp:ListItem>

</asp:RadioButtonList>

<asp:RequiredFieldValidator ID=”RequiredFieldValidator11″ runat=”server”

ControlToValidate=”RadioButtonList1″

ErrorMessage=”Select Gender*” Display=”Dynamic”></asp:RequiredFieldValidator>

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s