zoukankan      html  css  js  c++  java
  • 总是弹出“不重新发送信息,则无法刷新网页”!问题的解决办法

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

    1this.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>");

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

    欢迎回复!

  • 相关阅读:
    2019.7.28刷题统计
    2019.7.27刷题统计
    2019.7.26刷题统计
    2019.7.22刷题统计
    qdoj.xyz 6.18
    qdoj.xyz 6.17
    qdoj.xyz 6.16
    qdoj.xyz 6.15
    qdoj.xyz 6.14
    qdoj.xyz 6.13
  • 原文地址:https://www.cnblogs.com/strinkbug/p/581595.html
Copyright © 2011-2022 走看看