The ControlToValidate property of 'passwordCompare' cannot be blank

2.5k views Asked by At

In my page I have repeater using which I dynamically generate two textboxes & I have one compare validator.

Now for this validator I want to set ControlTovalidate & ControlToCompare. Id of both will come from two textboxes which are generated dynamically.

So while binding these textboxes to repeater I am setting both properties of validator But error comes as "The ControlToValidate property of 'passwordCompare' cannot be blank."

<asp:repeater id="repeater" runat="server" onitemdatabound="BoundProperty">
  <itemtemplate>
     <asp:panel id="panelProperty" runat="server" cssclass="prop">
           <asp:textbox id="textboxOrg" runat="server" cssclass="edit" visible="false"/>
    </asp:panel>
  </itemtemplate>
</asp:repeater>
<asp:comparevalidator id="passwordCompare" runat="server" controltovalidate="" controltocompare="" errormessage="CompareValidator"></asp:comparevalidator>
0

There are 0 answers