我使用了自定义验证器
protected void cvIsActive_ServerValidate(object source,ServerValidateEventArgs args)
{
if(args.Value.Length==1)
args.IsValid = true;
else
args.IsValid = false;
}
这是服务器验证的代码.. 我已经写过它是否检查过。我已经控制验证为复选框
<asp:CustomValidator runat="server" ErrorMessage="Please Select Status"
ID="cvIsActive" Font-Size="Smaller"
onservervalidate="cvIsActive_ServerValidate" ControlToValidate="chkIsActive"></asp:CustomValidator>
但是一旦页面加载它就会出错
Control 'chkIsActive' referenced by the ControlToValidate property of 'cvIsActive' cannot be validated.