Response.Write("<script>alert('The system makes a mistake, please contact with the manager!!');</script>");
这是我做的一个消息窗体,怎么点击完后,不能跳回我的首页,只能返回本页如果是 
Response.Redirect ("index.apsx");那就弹不出消息窗体。
我想实现,即有消息窗体,又能跳转。怎么实现?

解决方案 »

  1.   

    Response.Write("<script>alert('The system makes a mistake, please contact with the manager!!');</script>");
    Response.Redirect ("index.apsx");
    这样就可以了,下面紧跟着,跳转
      

  2.   


    /// <summary>
            /// 为用户弹出警告提示框
            /// </summary>
            /// <param name="key">警告KEY</param>
            /// <param name="Message">警告消息</param>
          public static void ShowMessageBox(string key,string Message)
          {
              Page p = (Page)System.Web.HttpContext.Current.Handler;
              p.ClientScript.RegisterStartupScript(p.GetType(), key, "<script>alert('"+Message+"');</script>");
          }
          /// <summary>
          /// 为用户弹出警告提示框
          /// </summary>
          /// <param name="key">警告KEY</param>
          /// <param name="Message">警告消息</param>
          /// <param name="GoToUrl">跳转的URL</param>
          public static void ShowMessageBoxToUrl(string key, string Message, string GoToUrl)
          {
              Page p = (Page)System.Web.HttpContext.Current.Handler;
              p.ClientScript.RegisterStartupScript(p.GetType(), key, "<script>alert('" + Message + "');window.location='" + GoToUrl + "'</script>");
          }
      

  3.   

    使用ShowMessageBoxToUrl("chenggong","注册成功","index.apsx");
      

  4.   

     Page.ClientScript.RegisterStartupScript(this.Page.GetType(), "msg", "alert('选择投标成功!');location.href='BidInfo_List.aspx';", true);