如何在单击另一个aspx页面中的按钮时重新加载aspx页面 [英] How to reload an aspx page upon clicking a button in another aspx page

查看:96
本文介绍了如何在单击另一个aspx页面中的按钮时重新加载aspx页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我坚持解决问题。我有一个父aspx页面,它有一个打开另一个aspx页面的按钮(不是button_click事件,页面是通过javascript打开的)。在新打开的页面中,我有一些文本字段和一个按钮。单击页面上的按钮后,将显示一个弹出框,在弹出框中单击确定后,它将关闭页面。到目前为止,它正如预期的那样运作。但我需要在关闭第二页时重新加载第一页。请问有谁请帮我解决这个问题。我不是javascript的专家。我非常感谢你的帮助。



谢谢



Raj

解决方案

您好,



请参考以下链接。



http://stackoverflow.com/questions/18736603/how-to- reload-parent-page-on-closing-popup-window [ ^ ]



谢谢,

Bh @ gyesh


将此脚本添加到头部。



<脚本> 
function closewindow()
{
window .opener。< span class =code-sdkkeyword> location .reload( true );
window .close();

}
< / script>





并在关闭按钮上调用它来重新加载父项窗口



喜欢这个



 <  输入    id   =  Button1   < span class =code-attribute> type   =  button    value   = 关闭    onclick   =  closewindow();    /  >  


Hi,

I'm stuck in solving a problem. I've a parent aspx page which has a button that opens another aspx page (not button_click event, the page is opened by javascript). In the new opened page, I've some text fields and a button. After clicking the button on the page, a popup box is displayed and upon clicking 'ok' in the popup box, it closes the page. So far, it's working as expected. But I need to reload the first page while closing the second page. Could anyone please help me how to solve this please. I'm not really expert in javascript. I'd really appreciate your help.

Thanks

Raj

解决方案

Hi,

Please refer following link.

http://stackoverflow.com/questions/18736603/how-to-reload-parent-page-on-closing-popup-window[^]

Thanks,
Bh@gyesh


Add this Script in Head.


<script>
    function closewindow()
    {
window.opener.location.reload(true);
window.close();
    
    }
    </script>



and call it on Close Button to Reload Parent window

like this

<input id="Button1" type="button" value="Close" onclick="closewindow();" />


这篇关于如何在单击另一个aspx页面中的按钮时重新加载aspx页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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