有A、B两个页面,点击A页面的某个按钮之后进入打开B窗口(B是一个弹出式窗口)
在B中做了一些操作之后,要返回A页面,由于在B页面中的一些操作,希望在A页面中显示出来,所以要刷新A页面,那么一般常规的做法是这样的:

1总是弹出“不重新发送信息,则无法刷新网页”!问题的解决办法this.ClientScript.RegisterStartupScript("refresh""<script>window.close();window.opener.location.reload(false);</script>");

采用这样的方式就会不可避免的带来标题上所说的那个问题,总是提示 “不重新发送信息,则无法刷新网页”
通过在网上的查找,找到了以下两种解决方式:
方式1:
将上面的代码替换为:
this.ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script>window.close();window.opener.form1.submit()</script>");
方式2:
将上面的代码替换为:
this.ClientScript.RegisterStartupScript(this.GetType(), "refresh", "<script>window.close();window.opener.location.href=window.opener.location.href</script>");

两种方式都已经验证过,可行!

欢迎回复!

 

相关文章:

  • 2021-12-14
  • 2021-12-06
  • 2022-02-12
  • 2021-11-07
  • 2022-12-23
  • 2022-01-26
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-06-14
  • 2022-12-23
  • 2021-07-23
  • 2022-12-23
  • 2021-12-03
  • 2022-03-06
相关资源
相似解决方案