如何从弹出窗口返回后阻止页面刷新? [英] how Prevent page refresh after returning from popup window?

查看:135
本文介绍了如何从弹出窗口返回后阻止页面刷新?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我从弹出窗口返回以下代码时,整个页面都会刷新。但我不想要这个。

When i back from popup window with below codes, the whole page is refreshed. but i do not want this.

Response.Write("<script>window.opener.location.href = window.opener.location.href;</script>");
Response.Write("<script>self.close();</script>");





但我必须根据弹出窗口中发生的情况刷新部分页面。



but i have to refresh part of page base on situation that happened in popup window.

推荐答案

如果您需要刷新部分页面,则可以使用更新面板。您可以将该部分放在UpdatePanel中。根据您的要求关闭弹出窗口时,您可以在父页面上调用javascript函数,该函数将调用UpdatePanel的_dopostback,并且该部分将被刷新。
If you need to refresh part of the page then you can use Update Panel. You can put the section in a UpdatePanel. When you are closing the popup depending on your requirement you can call a javascript function on the parent page which will in turn invoke _dopostback for the UpdatePanel and the section will be refreshed.


这篇关于如何从弹出窗口返回后阻止页面刷新?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆