如何获取customvalidator以在验证摘要中显示错误?

时间:2012-11-12 11:28:50

标签: asp.net

如何在我的validationsummary中显示我的复选框cbTermsandcond的customvalidator?

目前,错误消息显示在正在验证的复选框旁边。

<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>

注意,我的网页上的RequiredFieldValidator控件正确地显示在验证摘要中作为弹出框。

0 个答案:

没有答案