C#asp .net使用window.open以相同的方法打开两个文档 [英] C# asp .net open two documents in same method using window.open

查看:200
本文介绍了C#asp .net使用window.open以相同的方法打开两个文档的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


在我的Web应用程序中,我有两个复选框.
如果用户选中了X,则打开X.pdf.
如果用户选中Y,则打开Y.pdf.
到目前为止,它的工作情况还不错.
但是我想要的是,如果用户同时选中了两个复选框,则需要一个个地打开两个文档.

因此,代码将如下所示:

Hi,
In my web application i have two checkboxes.
If user checked X, then open X.pdf.
If user checked Y, then open Y.pdf.
Upto this its working fine.
But what i want is if user checkd both checkboxes, then need to open both documents one after another.

So code will be something like this:

private void xyz()
{
    ScriptManager.RegisterStartupScript(base.Page, base.Page.GetType(), "check1", "window.open(''../X.pdf'');", true);
    ScriptManager.RegisterStartupScript(base.Page, base.Page.GetType(), "check2", "window.open(''../Y.pdf'');", true);

}


但它只会首先打开pdf.
请让我知道是否有人希望进一步澄清我的问题.


But it only opens first pdf.
Please let me know if anyone wants more clearity about my question..

推荐答案

我将您的代码放在新页面中,效果很好.我认为问题出在别的地方.因此,为页面提供更多代码.
I put your code, in a new page, it works nice. I think problem is somewhere else. So, give more code of your page.


这篇关于C#asp .net使用window.open以相同的方法打开两个文档的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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