Page.RegisterStartupScript("back","("<script languge='javascript'> alert('本记录不允许编辑') </script>");
Response.redirect("aa.aspx");

解决方案 »

  1.   

    wrong, should be
    Response.write("<script languge='javascript'> alert('本记录不允许编辑');window.location.href='aa.aspx';</script>");
      

  2.   

    不用response.redirect<script>alert('xxxxxxxxx');location='url'</script>
      

  3.   

    用RegisterStartupScript就不略过了吗?
      

  4.   

    不好意思,上面的不对
    应该这样
            Page.RegisterStartupScript("back", "<script languge='javascript'> alert('本记录不允许编辑') ;location.href='aa.aspx';</script>")
      

  5.   

    Response.Write("<script>alert('记录修改成功!')</script>");
    Response.Write("<script>setTimeout(location.href='Query2.aspx',1000)</script>");
      

  6.   

    Page.RegisterStartupScript和Response.Write有什么不同吗?
      

  7.   

    Response.write("<script languge='javascript'> alert('记录不允许编辑');location.href='aa.aspx';</script>");
      

  8.   

    因为Response.redirect是在服务器端执行的,而javascript的做法是到客户端再解释的。
    也就是说,你的做法是结果是,html代码还没到客户端,页面就转向了
      

  9.   

    label.Text = "<script>alert('记录修改成功!')</script>";
      

  10.   

    不使用 Response.redirect("aa.aspx");
    用这句:
    Response.Write("<script language=javascript>window.location='aa.aspx';</script>");