这段代码好像没有执行,请大家帮我看看,急
.cs文件
ImageButton1.Attributes.Add( "onclick ", "return check( " + HiddenField1.ClientID + ", " + HiddenField2.ClientID + ", " + HiddenField3.ClientID + ", " + HiddenField4.ClientID + ") ");
protected void ImageButton1_Click(object sender, ImageClickEventArgs e)
{
if (this.HiddenField1.Value == "1 " && this.HiddenField2.Value == "1 " && this.HiddenField3.Value == "1 " && this.HiddenField4.Value == "1 ")
{
//true
insert(DBConnection);//插入客史
}
else
{
//false
Response.Write( " <script> alert( '请根据提示填写正确信息 ') </script> ");
Label4.Text = this.HiddenField1.Value;
Label3.Text = this.HiddenField2.Value;
Label2.Text = this.HiddenField3.Value;
Label5.Text = this.HiddenField4.Value;
}
页面脚本
function check(HiddenField1,HiddenField2,HiddenField3,HiddenField4)
{
HiddenField1.value= " ";
HiddenField2.value= " ";
HiddenField3.value= " ";
HiddenField4.value= " ";
if (document.all( "Register1_Label4 ").innerText== "请填写用户名 "||document.all( "Register1_Label4 ").innerText== "此用户名已被注册,请重新填写 "||
document.all( "Register1_Label3 ").innerText== "请填写证件号 "||document.all( "Register1_Label3 ").innerText== "此证件号已被注册,请重新填写 "||document.all( "Register1_Label3 ").innerText== "请填写正确的证件号 "||
document.all( "Register1_Label2 ").innerText== "请填写电话号码 "||document.all( "Register1_Label2 ").innerText== "此电话号码已被注册,请重新填写 "||document.all( "Register1_Label2 ").innerText== "请请填写正确的电话号码 "||
document.all( "Register1_Label5 ").innerText== &quo