views:

194

answers:

1

Hi,

I am using dropdownlist control and a RequiredFieldValidator control for that ddl inside the gridview.

<asp:DropDownList ID="ddlInsert" runat="server" CssClass="normal" DataSourceID="sqlDataSource" DataTextField="Name"  DataValueField="ID" SelectedValue='<%# Bind("ID") %>'  AppendDataBoundItems="true">
              <asp:ListItem  Text="--Select--" Value="-1" Selected="True" />
              </asp:DropDownList>
               <asp:RequiredFieldValidator ID="requiredDDL" runat="server" ControlToValidate="ddlInsertRegion" ErrorMessage="*" InitialValue="-1" Display="Dynamic"></asp:RequiredFieldValidator>

But this validator is not working

+1  A: 

ControlToValidate="ddlInsertRegion" in the validator but the DropDownList control ID is ID="ddlInsert"

B-Rain
Thank you. I have missed the validationgroup property.
Geetha