弹出信息无反应!为何?
在自己机器上没问题,用别人机器访问弹不出来,放到服务器,用自己的机器访问也谈不出来,但是信息已经添加成功。只是this.Response.Write( " <script language=\ "javascript\ "> show_name= '您注册成功,要成为会员请您联系我们! ' </script> "); 无法弹出来。
this.Response.Write( " <script language=\ "javascript\ "> show_name= '您注册成功,要成为会员请您联系我们! ' </script> ");在程序别的页面中也有用,可以弹出。
具体按钮代码如下:
private void tb_tijiao_Click(object sender, System.EventArgs e)
{
if(tb_password_again.Text.ToString()!=tb_password.Text.ToString())
{
this.Label2.Text= "密码不一致 ";
return;
}
clcw.common.classes.member newMember=new clcw.common.classes.member(this.Application[ "connStr "].ToString());
if(newMember.checkUser(this.tb_username.Text.Trim()))
{
this.Response.Write ( " <script language=\ "javascript\ "> show_name= '提交失败!您想要注册的用户名应经存在! ' </script> ");
return;
}
newMember.strPwd=this.tb_password.Text.Trim();
newMember.strUsername=this.tb_username.Text.Trim();
newMember.strName=this.tb_realname.Text.Trim();
newMember.strPhone=this.tb_corporation_phone.Text.Trim();
newMember.strEmail=this.tb_email.Text.Trim();
if(newMember.addMember()> 0)
{
this.Label2.Text= " ";
this.Response.Write( " <script language=\ "javascript\ "> show_name= '您注册成功,要成为会员请您联系我们! ' </script> ");
}
else
{
this.Response.Write ( " <script language=\ "javascript\ "> show_name= '提交失败!请您重新注册! ' </script> ");
}
}
------解决方案--------------------或者
this.Response.Write ( " <script language=\ "javascript\ "> var show_name= '提交失败!您想要注册的用户名应经存在! ';alert(show_name); </script> ");
------解决方案--------------------HttpContext.Current.Response.Write( " <script type=\ "text/javascript\ "> alert(\ "提交失败!您想要注册的用户名应经存在!\ "); </script> ");