HawaiiDragon
asked on
Validate Radio button lists and Check box lists C#
Hello Experts,
I am trying to validate that selections have been made on Radio button lists and check box list controls and I am banging my head against the wall.
This is my code and I have no idea how to make it work….. HELP
if (RBLType.SelectedValue = null)
{ pnlwarning.Visible = true;}
else
{ pnlwarning.Visible = false; }
if (CBLStatus != checked)
{pnlwarning.Visible = true;}
else
{pnlwarning.Visible = false;}
I am trying to validate that selections have been made on Radio button lists and check box list controls and I am banging my head against the wall.
This is my code and I have no idea how to make it work….. HELP
if (RBLType.SelectedValue = null)
{ pnlwarning.Visible = true;}
else
{ pnlwarning.Visible = false; }
if (CBLStatus != checked)
{pnlwarning.Visible = true;}
else
{pnlwarning.Visible = false;}
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks all
ASKER
So would I put it in the head section of the page before the content section? And How would I call it I have included the two controls in HTML
<%@ Page Language="C#" MasterPageFile="~/MasterPa
<head>
</head>
<asp:Content ID="Content1" ContentPlaceHolderID="head
<p>
<asp:RadioButtonList ID="RBLType" runat="server">
<asp:ListItem Value="275">Student ($275)</asp:ListItem>
<asp:ListItem Value="816.50">Student & Spouse ($816.50)</asp:ListItem>
<asp:ListItem Value="816">Student & Children ($816)</asp:ListItem>
<asp:ListItem Value="1159">Student, Spouse & Children ($1159)</asp:ListItem>
</asp:RadioButtonList>
</p>
<p>Please mark any of the following that apply to you: <asp:CheckBoxLis
ID="CBLStatus" runat="server" TextAlign="Right" Width="299px">
<asp:ListItem>Full-time Residential Student</asp:ListItem>
<asp:ListItem>F-1 International Status</asp:ListItem>
<asp:ListItem>Athlete</asp
<asp:ListItem>Nursing</asp
<asp:ListItem>Other</asp:L
</asp:CheckBoxList>
</p>