ASP.NET Custom Validator Error Message: Control referenced by the property cannot be validated

Posted by Jan-Frederik Carl on Stack Overflow See other posts from Stack Overflow or by Jan-Frederik Carl
Published on 2010-04-14T13:29:34Z Indexed on 2010/04/14 13:33 UTC
Read the original article Hit count: 318

Hello, I use ASP.NET and have a Button and a CustomValidator, which has to validate the button.

<asp:Button ID="saveButton" runat="server" OnClick="SaveButton_Click" Text="Speichern"
    CausesValidation="true"/>
<asp:CustomValidator runat="server" ID="saveCValidator" Display="Static"
    OnServerValidate="EditPriceCValidator_ServerValidate"   
    ControlToValidate="saveButton" ErrorMessage="">

When loading the page, I receive the error message:

"Control 'saveButton' referenced by the ControlToValidate property of 'saveCValidator' cannot be validated."

What might be the problem? I searched on the net, but this didn´t help much.

© Stack Overflow or respective owner

Related posts about ASP.NET

Related posts about customvalidator