locked
Problem for Required Feild Validator (Checkbox List) control RRS feed

  • Question

  •  

    Hi,

     

     I am trying to use required field validator for checkbox list control, but getting problem to do so.

     


     <asp:CheckBoxList ID="CheckBoxList1" runat="server">
            <asp:ListItem>p1</asp:ListItem>
            <asp:ListItem>s2</asp:ListItem>
            </asp:CheckBoxList>
            <asp:RequiredFieldValidator ControlToValidate="CheckBoxList1" ID="RequiredFieldValidator1" runat="server" 
    ErrorMessage="RequiredFieldValidator"></asp:RequiredFieldValidator>

    when I run this I am getting following error

     

    Control 'CheckBoxList1' referenced by the ControlToValidate property of 'RequiredFieldValidator1' cannot be validated.

    Thursday, October 13, 2011 4:19 AM

Answers

All replies