1

How do I get my customvalidator for my checkbox cbTermsandcond to display in my validationsummary?

At the moment, the error message is displaying next to the checkbox that's being validated.

<div class="mainbookingcheckboxleft">
    <asp:CheckBox ID="cbTermsandcond" runat="server" />
    <asp:CustomValidator ID="CustomValidator1" runat="server" 
        ErrorMessage="You must agree with our Terms and Conditions" 
            onservervalidate="CustomValidator1_ServerValidate">
    </asp:CustomValidator>

    <asp:ValidationSummary ID="ValidationSummary1" runat="server" 
        ShowMessageBox="true"  ShowSummary="False" />
</div>

Note, my RequiredFieldValidator controls on my webpage are displaying in the Validation summary as a popup box correctly.

IrishChieftain
  • 15,108
  • 7
  • 50
  • 91
TeaDrinkingGeek
  • 1,995
  • 5
  • 34
  • 52
  • Possible duplicate: [elegant way to make customvalidator work with validationsummary](http://stackoverflow.com/questions/811734/elegant-way-to-make-customvalidator-work-with-validationsummary-messagebox) – Blachshma Nov 12 '12 at 11:32
  • That duplicate answer is 3 years old, and part of the script is now redundant. I need a fresh new answer. – TeaDrinkingGeek Nov 12 '12 at 11:42

0 Answers0