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>");

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

    欢迎回复!

  • 相关阅读:
    单例模型
    数据库7 索引
    数据库6.高级
    数据库5 不想改
    绑定方法与非绑定方法 反射 内置方法
    组合 封装 多态
    面向对象之继承
    面向过程编程
    logging hashlib 模块
    pickle json xml shelve configparser模块
  • 原文地址:https://www.cnblogs.com/strinkbug/p/581595.html
Copyright © 2011-2022 走看看