如何在弹出窗口关闭时使页面进行回发 [英] how to make an page to do postback whenever pop up window is closed

查看:62
本文介绍了如何在弹出窗口关闭时使页面进行回发的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,



我有一个按钮点击我在弹出的窗口中打开.aspx页面,每当弹出窗口关闭时,我想要让页面做回发,我打电话给这个弹出窗口。



我的弹出窗口代码是

< script type =   text / javascript> 
function GetData(){
var url = http:// localhost:53123 / Abc.aspx;
var popupSetting = center = yes,高度= 355,宽度= 700,工具栏=没有,目录=没有,状态=没有,滚动条=没有,可调整大小=无,模态=是;
var pmx = window .open(url,' 添加窗口',popupSetting);

}
< / script>



和我打电话的按钮是

< pre lang =HTML> < asp:按钮 ID = btnAddInfo runat = server 文本 = 添加新 宽度 = 120px < span class =code-attribute> OnClientClick =' 返回GetData (); ' / >



请告诉我该怎么做..

解决方案

替换窗口.open 使用 ShowModalDialog [ ^ ]



阅读此窗口-showmodaldialog-vs-window-open [ ^ ]


 <   script     type   =  text / javascript >  
function GetData( ){
var url =http:// localhost:53123 / Abc.aspx;
var popupSetting =center = yes,height = 355,width = 700,toolbar = no,directories = no,status = no,scrollbars = no,resizable = no,modal = yes;
var pmx = window.open(url,'添加窗口',popupSetting);
返回true;

}
< / script >







在你的javascript函数中使用return true将回发你的页面


1)在页面whare中放一个你想要回帖的按钮

2)在代码后面创建点击事件

)关闭javascript后弹出按钮点击事件



< script> 
<跨度类= 代码sdkkeyword>文档 .getElementById(<跨度类= 代码串> <跨度类= 代码串 > btnId1< /跨度>)点击();
< / script>


Hello,

I have an button on which click i am opening an .aspx page in window pop up and whenever the pop up is closed ,I want to make the page to do postback from which i am calling this pop up.

My pop up window code is

<script type="text/javascript">
        function GetData() {
            var url = "http://localhost:53123/Abc.aspx";
            var popupSetting = "center=yes,height=355,width=700,toolbar=no,directories=no,status=no,scrollbars=no,resizable=no,modal=yes";
            var pmx = window.open(url, 'Add  Window', popupSetting);

        }
    </script>


and button on which i am calling is

<asp:Button ID="btnAddInfo" runat="server" Text="Add New" Width="120px" OnClientClick=' return GetData(); ' />


Please tell me how can i do this..

解决方案

Replace window.open with ShowModalDialog[^]

read this window-showmodaldialog-vs-window-open[^]


<script type="text/javascript">
        function GetData() {
            var url = "http://localhost:53123/Abc.aspx";
            var popupSetting = "center=yes,height=355,width=700,toolbar=no,directories=no,status=no,scrollbars=no,resizable=no,modal=yes";
            var pmx = window.open(url, 'Add  Window', popupSetting);
return true;

        }
    </script>




use return true in your javascript fuunction it will postback your page


1)Put one button in page whare you want post back
2) create click event in code behind
3)call button click event after closing pop from javascript

<script>
document.getElementById("btnId1").click();
</script>


这篇关于如何在弹出窗口关闭时使页面进行回发的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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