this.Response.Write("<script language='javascript'>alert('用户注册成功!');</script>");
this.Response.Write("<script language='javascript'>window.location.href('WebForm1.aspx');</script>");
下面:
Response.Write("<script>alert('注册成功')</script>");
Response.Regedit("WebForm1.aspx);
上面是对的  为什么下面没有弹出对话框就直接跳转页面if(document.all("TextName").value=="")是页面上的提示document.alert("不能为空");
       document.form1.IDlod.select();
登录的判断
if(document.form1.IDlod.values()=="")
       document.alert("用户名不能为空");
       document.form1.IDlod.select();
这两个有什么区别

解决方案 »

  1.   

    this.Response.Write("<script language='javascript'>alert('用户注册成功!');</script>");
    this.Response.Write("<script language='javascript'>window.location.href('WebForm1.aspx');</script>");
    下面:
    Response.Write("<script>alert('注册成功')</script>");//这个只是输出script, 后台执行完后,加载时 加载到他 他才执行
    Response.Regedit("WebForm1.aspx);//这里 就直接跳转了, 没有加载本页的HTML
    上面是对的  为什么下面没有弹出对话框就直接跳转页面
      

  2.   

      上面提示对话框 是因为 js 是一步步执行  先alert 提示对话框 然后跳转。   而下面 Response.Regedit("WebForm1.aspx);  是微软封装的方法,先跳转,顺序问题
      

  3.   


    this.Response.Write("<script language='javascript'>alert('用户注册成功!');location.href('WebForm1.aspx');</script>");
      

  4.   

    原因很简单:
    Response.Write("<script>alert('注册成功')</script>");
    这段代码发送一段Javascript脚本,脚本必须发送到客户端后才能执行Response.Regedit("WebForm1.aspx);
    这段代码直接就从当前页跳转到webform1.aspx了,也就是当前页面根本就没发送任何内容到客户端,所以你上面的客户端代码永远不会被执行
      

  5.   

    this.Response.Write("<script language='javascript'>alert('用户注册成功!');</script>");
    this.Response.Write("<script language='javascript'>window.location.href('WebForm1.aspx');</script>");
    都是执行脚本代码!!
    Response.Write("<script>alert('注册成功')</script>");
    Response.Regedit("WebForm1.aspx)//是服务器响应
      

  6.   

     Response.Write("<script language=javascript>alert('注册成功!');location.href = “*.aspx”;</script>");
      

  7.   

    Response.Regedit("WebForm1.aspx);直接在服务器端跳转了,没有经过前台页面,所以alert根本就没有机会执行。