为什么我这样写不对,既没有弹出提示框,也没有跳转。(我跟的时候发现进了if语句的)
 if (Request.QueryString["url"]==null)
        {
            Response.Write("<script>alert('修改成功!');location.href='myvideo.aspx?Index=1';</script>");
        }
我写的有问题吗,可是我上网查的,都说这么写没有问题的啊。请教。页面跳转

解决方案 »

  1.   

    是的,只要没有弹出框,直接这样写Response.Redirect("myvideo.aspx?Index=1");是可以跳转的
      

  2.   

    用ClientScriptManager吧,或者ScriptManager.RegisterStartupScript
      

  3.   

    Request.QueryString["url"]是不是有值呢?
      

  4.   

    Response.Write("<script>alert('恭喜你,注册成功..');window.location.href='index.aspx?index=1';</script>");测试成功..
      

  5.   

     if (Request.QueryString["url"]==null)
            {
                Response.Write("<script>alert('修改成功!');location.href='myvideo.aspx?Index=1';</script>");
             //这样写没有问题,问题是少了些语句
                  Response.End()//或return;
            }