C# 复选框必需的验证器
我在asp.net中开发了一个应用程序,在我的页面上有一个复选框,它是必填字段,我在验证后编码,但按save validation时没有调用C# 复选框必需的验证器,c#,javascript,asp.net,validation,checkbox,C#,Javascript,Asp.net,Validation,Checkbox,我在asp.net中开发了一个应用程序,在我的页面上有一个复选框,它是必填字段,我在验证后编码,但按save validation时没有调用 <asp:CheckBox ID="ChkContent" runat="server" Text=" I hereby certify that the information above is true and accurate." Font-Bold="true" />
<asp:CheckBox ID="ChkContent" runat="server" Text=" I hereby certify that the information above is true and accurate."
Font-Bold="true" />
<asp:CustomValidator ID="Custom1" CssClass="errorTop" ClientValidationFunction="CheckBoxValidation" runat="server"
ErrorMessage="You must select this box to proceed" ></asp:CustomValidator>
验证函数未调用。在自定义验证程序控件中添加ValidationGroup=“AddMisc”
<asp:CheckBox ID="ChkContent" runat="server" Text=" I hereby certify that the information above is true and accurate."
Font-Bold="true" />
<asp:CustomValidator ID="Custom1" CssClass="errorTop" ClientValidationFunction="CheckBoxValidation" runat="server"
ErrorMessage="You must select this box to proceed" ></asp:CustomValidator>
<asp:CheckBox ID="ChkContent" runat="server" Text=" I hereby certify that the information above is true and accurate."
Font-Bold="true" />
<asp:CustomValidator ID="Custom1"
CssClass="errorTop"
ClientValidationFunction="CheckBoxValidation"
runat="server"
ErrorMessage="You must select this box to proceed"
ValidationGroup="AddMisc">
</asp:CustomValidator>
在自定义验证器控件中添加ValidationGroup=“AddMisc”
。
<asp:CheckBox ID="ChkContent" runat="server" Text=" I hereby certify that the information above is true and accurate."
Font-Bold="true" />
<asp:CustomValidator ID="Custom1"
CssClass="errorTop"
ClientValidationFunction="CheckBoxValidation"
runat="server"
ErrorMessage="You must select this box to proceed"
ValidationGroup="AddMisc">
</asp:CustomValidator>