AJAX Modalpopup并打开新窗口 [英] AJAX Modalpopup and open new window

查看:64
本文介绍了AJAX Modalpopup并打开新窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我有一个AJAXMOdalpopup,在弹出面板上我正在显示一些数据,并带有确定"和取消"按钮.当用户单击确定"按钮时,应打开新窗口.为此,我写了下面的代码.

Hi,

I have a AJAXMOdalpopup, on the popup panel i am showing some data and with "OK" and "CANCEL" button. when user clicks on the "OK" button it should open new window. for this i have written below code.

<br />
<pre><br />
protected void btnMQReport_Click(object sender, EventArgs e)<br />
{        <br />
<br />
string popupScript = "<script language=''javascript''>" +<br />
"window.open(''http://google.com'', ''Google'', " +<br />
"''width=1000, height=1000, menubar=yes, resizable=yes'')" + "</script>";<br />
            Page.ClientScript.RegisterStartupScript(this.GetType(),"Google", popupScript);<br />
}</pre><br />
<br />





当我单击确定"按钮时,modalpopup disapperas没有任何反应.





when i click on the ''OK'' button modalpopup disapperas and nothing happening.

推荐答案

我首先想到的是modal popup不会引起回发,而该回发会插入指定的脚本在响应流中,然后执行.

创建一个JavaScript函数,并在单击确定"按钮时执行它,而不是尝试使用RegisterStartupScript注入代码.
My first thought would be the modal popup is not causing a postback which would insert the specified script in the response stream and thus have it execute.

Create a JavaScript function and have it execute when the OK button is clicked rather trying to inject the code with RegisterStartupScript.


这篇关于AJAX Modalpopup并打开新窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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