2012-07-18 2 views
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); 
+0

변화를 한 PopupName 할 것, 창 이름은 – Ricky

답변

2

두 개의 창 고유 한 이름이 필요합니다

내 코드입니다. 두 번째 PopupName을 변경하고 도움이되는지 확인하십시오.

+0

+1 고유해야합니다. 예, 대부분 그렇습니다. –

0

나는 보통 ..

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

//this would make the window name unique 
. 
. 
. 
+0

은 파일 이름에 404 마이트가되지만 날짜 시간 부분도 포함되지만 파일은 이미 생성되어 있으므로 작동하지 않습니다. –

+0

@ JigarPandya : 고마워요. 그에 따라 답변이 업데이트되었습니다. –

관련 문제