admin管理员组文章数量:1391925
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 sowindow.opener.location.reload
could do the trick. – pimvdb Commented May 8, 2011 at 19:11
2 Answers
Reset to default 5To 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
本文标签: cRefresh page on popup closeStack Overflow
版权声明:本文标题:c# - Refresh page on popup close? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744754459a2623376.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论