如何从子窗口刷新父窗口 [英] How to refresh the parent window from the child window

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

问题描述

HI,

如何从asp.net(.cs页面)中关闭的子窗口刷新父窗口.我们正在使用



How to refresh the parent window from child window close in asp.net(.cs page).We are using

page.ClientScript.RegisterStartupScript(this.GetType(), "PopupSave", <pre lang="c#"><a href=""></a>[<a href="" target="_blank"></a>]"<script>javascript:alert('Successfully Saved'); window.close();window.top.opener.RefreshPage();</script>");




用于从子窗口关闭刷新父页面.

在这里


RefreshPage()是一个自定义函数




for refresh the parent page from child window close.

here


RefreshPage() is a custom function

function RefreshPage() {
    window.document.forms[0].submit();
}




它在IE中工作正常,但在Mozilla Firefox和Google chrome中无法正常运行.
请帮助我,这对我来说是非常紧急的要求.

问候
Nagamuneendra Reddy




it is working fine in IE but not in Mozilla Firefox and Google chrome.
please help me it is very urgent requirement for me.

Regards
Nagamuneendra Reddy


推荐答案

您可以在按钮上单击以调用javascript函数,以关闭子窗口.

尝试以下代码:

在您的childpage.aspx页中,添加一个按钮控件,



单击按钮控件后,调用javascript函数

函数closeme()
{
opener.location.href ="ParentPage.aspx"
window.close();
}

它对我有用.
You can call the javascript function on the button click to close the child window.

Try the following code:

in your childpage.aspx page, add a button control ,



On click of the button control, call the javascript function

function closeme()
{
opener.location.href="ParentPage.aspx"
window.close();
}

it worked for me..


这篇关于如何从子窗口刷新父窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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