WebUIValidation.js is a javascript file whose functions become part of your web page when you add controls like RequiedFieldValidatorif there is any control on your page that needs this kind of validation, some function in WebUIValidation.js will be called when you click on a submit-type button on the client side. After the validation passes on the client side, the form will be submitted back to the server. On the server, the same server controls will be validated again
其实指明这个文件的位置,但是browser会将这个文件读入到客户机中。在你要求使用的时候,就象你在本页面所写的这些过程一样。
所以不会在客服务器端处理。
private void Button1_Click(object sender, System.EventArgs e)
{
if(!this.Page.IsValid)
{
Page.RegisterStartupScript("alert", "<script language='javascript'> alert('输入数据有误!')</script>");
return;
}
this.Label1.Text=this.TextBox1.Text;
Page.RegisterStartupScript("alert", "<script language='javascript'> alert('成功!')</script>");
}