CustomValidator,用户自定义的验证控件的简单例子










ControlToValidate="TextBox3" ErrorMessage="嘿嘿,错了哈"
onservervalidate="CustomValidator1_ServerValidate"
ClientValidationFunction="must1">








protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
{
if (args.Value == "1")
{
args.IsValid = true;
}
else
{
args.IsValid = false;
}
}

你可能感兴趣的:(CustomValidator,用户自定义的验证控件的简单例子)