RegularExpressionValidator验证未通过的话,可以同时清空验证的文本框么?
1 回答

拉丁的传说
TA贡献1789条经验 获得超8个赞
private void Button1_Click(object sender, System.EventArgs e)
{
//RegularExpressionValidator1属性设置
RegularExpressionValidator1.Validate();//进行验证
if (!RegularExpressionValidator1.IsValid)
{
RegularExpressionValidator1.ErrorMessage = "错误提示信息!";
//清空txtBox
}
}
- 1 回答
- 0 关注
- 289 浏览
添加回答
举报
0/150
提交
取消