我的:
 alert();   //  ....
Response.Redirect("1.aspx");  // 本页面这样就不弹出对话框了...我是希望alert后刷新本页面----
前段时间发过这个帖子,很多人说用:
...
alert("Alert text");
location.href="1.aspx";
...
这个不弹出对话框
有人说用:alert("Alert text");location.reload();
这个好象是个死循环,点按钮后出来“不发送消息则无法刷新页面”
选“重试”对话框仍在,选"取消"的话alert有效,但是对话框仍在。。
只有用任务管理器强关了....

解决方案 »

  1.   

    string script = "<script>window.alert('回复成功');window.location.href=window.location.href ;</script>";
                    Page.RegisterStartupScript("xxx", script);,这样写试试
      

  2.   

    我的:
     alert();   //  ....
    Response.Redirect("1.aspx");  // 本页面redirect导致response.end.........
      

  3.   

    System.Web.HttpContext.Current.Response.Write("<script>alert('hello');location.href='index.aspx';</" + "script>");
    这样就刷新了.index.aspx改为你要返回的页面地址