c# - Refresh page on popup close? - Stack Overflow

So I've used javascript to open a popup window in asp with c# codebehind, and I need a buttonclick

So I've used javascript to open a popup window in asp with c# codebehind, and I need a buttonclick event on the popup to both close the popup and refresh the parent page. Is there a method for this?

So I've used javascript to open a popup window in asp with c# codebehind, and I need a buttonclick event on the popup to both close the popup and refresh the parent page. Is there a method for this?

Share Improve this question edited May 8, 2011 at 19:13 Ace Troubleshooter asked May 8, 2011 at 19:04 Ace TroubleshooterAce Troubleshooter 1,3797 gold badges29 silver badges44 bronze badges 1
  • 1 You can access window.opener from within the popup so window.opener.location.reload could do the trick. – pimvdb Commented May 8, 2011 at 19:11
Add a ment  | 

2 Answers 2

Reset to default 5

To change the location/refresh the parent window you can use the opener property.

This one will change the href of the parent from the pop-up.

window.opener.location.href = the_url;

The reload method will work too, This does a hard reload (returns forms to default values) The optional boolean conditional argument will if true make a new request of the server, if false it will attempt to pull the page from the cache.

window.opener.location.reload(true);

If you want to preserve form data (soft reload), use the history method.

window.opener.history.go(0); 

'0' causes the page to reload, a negative value represents how many steps backward you'd like to go.

Also try this

window.location.href=window.location.href

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1744754460a4591795.html

相关推荐

  • c# - Refresh page on popup close? - Stack Overflow

    So I've used javascript to open a popup window in asp with c# codebehind, and I need a buttonclick

    5小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信