From: xbound on 13 May 2010 18:41
I have two dropdowns: I've added a first item like "Please Select" to each
and each has it own RequiredFieldValidator control which fires if the user
does not select something. The code for the second one looks like this
<asp:DropDownList ID="ddl2" runat="server" AutoPostBack="true"
<asp:ListItem Text="Please select" Value="0" />
<asp:RequiredFieldValidator ID="reqddl2" runat="server"
Display="Dynamic" ErrorMessage="Name is required"
The second dropdown is populated depending on what's selected in the first
one. In the SelectedIndexChanged event of the first dropdown I've added
this statement [ ddl2.Items.Insert(0, "Please Select") ] because otherwise
that first item won't show up in the second dropdown anymore once the value
in the first dropdown has changed. The problem is that afterward the
validation control for the second dropdown no longer works.
So do I need to validate the second dropdown manually? Any insight