程序代码为:
if (权限==false)
{
  Response.Write("<script>alert('"+"该用户没有进入招标管理页面的权限!"+"');</script>");
  Response.Redirect("~/main.aspx");
}
else
{
 BindZbData()
}
现在的问题是:提示信息:Response.Write("<script>alert('"+"该用户没有进入招标管理页面的权限!"+"');</script>");没有显示出来?用什么方法先显示后转入页面呢?

解决方案 »

  1.   

     Response.Write(" <script>alert('"+"该用户没有进入招标管理页面的权限!"+"');location.href='Index.aspx';</script>"); 
      

  2.   

    string msg = "该用户没有进入招标管理页面的权限";
    Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "js", "<script>alert('" + msg + "');window.location.href='main.aspx';</script>");href里边的路径你自己写.
      

  3.   

    Response.Write(" <script>alert('"+"该用户没有进入招标管理页面的权限!"+"');location.href='Index.aspx'; </script>"); 楼上正解
      

  4.   

    应减少使用Response.Write输出脚本..
      

  5.   

      string str = "<script language='JavaScript'>alert('" + Msg + "');window.location.replace('" + Url + "');</script>";
      HttpContext.Current.Response.Write(str);
      

  6.   

    因为系统 先执行服务器端代码,后执行客户端js,所以会出现你的问题程序代码为:
    if (权限==false)
    {
      Response.Write(" <script>alert('"+"该用户没有进入招标管理页面的权限!"+"'); </script>");
      //Response.Redirect("~/main.aspx");  
      -》Response.Write(" <script>location.href='/main.aspx'; </script>");
    }
    else
    {
    BindZbData()
      

  7.   

    to yuelailiu:朋友路径怎么设呢?main.aspx的正确路径为:/wshtgl/main.aspx,而现在的路径为/wshtgl/admin/user/main.aspx
      

  8.   

    Response.Write("<script>window.location.href='newscenter.aspx';alert(\"对不起,不是正确ID不能进入!\")</script>");