从ServerSide单击一次即可显示两个弹出浏览器窗口 [英] Show two Popup browser window at a single Click from ServerSide

查看:70
本文介绍了从ServerSide单击一次即可显示两个弹出浏览器窗口的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



在我的asp.net应用程序中,我需要显示两个不同的Popup窗口,其中包含两个不同的报告以进行Printout.

因此,单击时我需要一次显示两个Popup.s,这是我用来显示popup的代码.我尝试两次运行相同的脚本(使用不同的Page.aspx),但最终只显示了一个弹出窗口.




In my asp.net application, i need to show two different Popup window containing two different report to take Printout.

Hence while click i need to show two Popup''s at a time.Here is the code i used for showing popup. I tried to run same script twice(with different Page.aspx) but at finally only one Popup are shown.


string url = "Billview.aspx";
string fullURL = "window.open('" + url + "', '_blank', 'height=350,width=475,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no' );";
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", fullURL, true);

推荐答案

这并不是真正的服务器端,您只是在注册一些JavaScript以在页面加载时运行.因此,只需更新JavaScript以打开两个窗口即可:

This isn''t really server-side, you''re just registering some JavaScript to run on page load. So just update the JavaScript to open two windows:

string url1 = "Billview.aspx", url2 = "Whatever.aspx?somestuff=42";
string js = "window.open(''" + url1 + "'', ''_blank'', ''height=350,width=475,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no'' );\n" +
    "window.open(''" + url2 + "'', ''_blank'', ''height=350,width=475,status=yes,toolbar=no,menubar=no,location=no,scrollbars=yes,resizable=no,titlebar=no'' );
ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", js, true);


这篇关于从ServerSide单击一次即可显示两个弹出浏览器窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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