0

我需要在 asp.net C# 中单击一个按钮时打开两个 pdf 文件作为弹出窗口,但现在它只打开第一个弹出窗口?有人可以帮我同时打开两个窗口吗?

这是我的代码:

string PDFPath = folderpath + filename;
                string PopupName = "popUp";
                string PopupSettings = "height=900,width=1000,top=100,left=100,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,status=yes";
                string NewPath = "var popup=window.open('../PopupForReport.aspx?pdfPath="
                    + PDFPath.Replace("\\", "/") + "','" + PopupName + "','" + PopupSettings + "')";
ScriptManager.RegisterStartupScript(updatePanel1, updatePanel1.GetType(), "popupOpener", NewPath, true);



string PDFPath1 = folderpath + filename1;
                string PopupName = "popUp";
                string PopupSettings = "height=900,width=1000,top=100,left=100,scrollbars=no,resizable=no,toolbar=no,menubar=no,location=no,status=yes";
                string NewPath1 = "var popup=window.open('../PopupForReport.aspx?pdfPath="
                    + PDFPath1.Replace("\\", "/") + "','" + PopupName + "','" + PopupSettings + "')";
ScriptManager.RegisterStartupScript(updatePanel1, updatePanel1.GetType(), "popupOpener", NewPath1, true);
4

2 回答 2

2

这两个窗口需要唯一的名称。尝试更改第二个 PopupName 并查看是否有帮助。

于 2012-07-18T05:56:45.003 回答
0

我通常会这样做..

string PDFPath = folderpath + filename;
string wndName = "Window" + DateTime.Now;

//this would make the window name unique
.
.
.
于 2012-07-18T06:02:01.263 回答