关闭弹出窗口后,将控件转移到父表单的页面加载中 [英] transfer control to page load of parent form after closing the popup

查看:68
本文介绍了关闭弹出窗口后,将控件转移到父表单的页面加载中的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在gridview中有一个按钮.单击该按钮后,将弹出一个窗口.
但是,当我关闭弹出窗口时,控件不会转移到父级Web表单的页面加载事件.

I have i gridview in which I have a button. After clicking the button a popup opens.
But when I close the popup the control doesnot transfer to the page load event of parent web form.

how can i do this?

推荐答案

您需要从JavaScript触发父页面加载.
You need to trigger a parent page load from JavaScript.
window.close("");
parent.refresh();




OR

window.close();
if (window.opener && !window.opener.closed) {
window.opener.location.reload();
}




另外,如果您使用的是Ajax,请参阅以下文章:
在子窗口关闭时通过AJAX(ASP.NET 2.0)对父页面进行部分更新-有条件地 [ ^ ]




Alternatively, if you are using Ajax, have a look at this article:
Partial update of parent page via AJAX (ASP.NET 2.0) on close of a child window - conditionally[^]


您使用的是哪种弹出窗口?另一个窗口还是一个隐藏的div?

我希望后者,因为那样不会被您的浏览器弹出窗口阻止程序阻止.

然后您可以打电话(检查这我可能是错的.)parent.refresh();

如果是前者.

window.opener.location.reload();附加到子窗口的onunload事件.

就个人而言,我将使用jquery滚动某些内容,并使用ajax调用来调用特定方法来重新绑定您的gridview.

这会让您入门.

http://api.jquery.com/jQuery.post/ [
What kind of popup are you using? Another window or a hidden div?

I would hope the latter since that wouldn''t be blocked by your browsers popup blocker.

you could then just call (check this I could be wrong.) parent.refresh();

if it''s the former.

window.opener.location.reload(); attached to your onunload event of the child window.

Personally I would roll something using jquery and use an ajax call to call the specific method to rebind your gridview.

This would get you started.

http://api.jquery.com/jQuery.post/[^]


这篇关于关闭弹出窗口后,将控件转移到父表单的页面加载中的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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