Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
vk18
Posting Yak Master
146 Posts |
Posted - 2007-04-17 : 13:36:06
|
Hi,I am trying to pop up 2 pdf's at a time, when i write this below code only the first one is being poped up where as the second onedoesnot. Any Idea.? Thanks popupScript = "<script language='javascript'>" & _"window.open('invoicerpt.aspx?id=" & Me.txtinvoicenumber.Text & "&sid=" & showStartDate & "&rid=" & showrates & "&cid=" & showcomm & "&drid=" & draft & "&t=pdf', 'CustomPopUp', " & _"'status=yes,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,width=790,height=500')" & _"</script>" Page.RegisterStartupScript("PopupScript", popupScript) popupscript = "<script language='javascript'>" & _"window.open('InvoiceSummaryReport.aspx?id=" & Me.txtinvoicenumber.Text & "&rid=" & showrates & "&cid=" & showcomm & "&t=pdf', 'CustomPopUp', " & _"'status=yes,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,width=790,height=500')" & _"</script>" Page.RegisterStartupScript("PopupScript", popupscript) |
|
jsmith8858
Dr. Cross Join
7423 Posts |
Posted - 2007-04-17 : 14:14:00
|
Read the documentation on how RegisterPopUpScript works. The first argument must be unique per script. Because you are using the same value for both ("PopUpScript"), the second one overwrites the first.Also --- always look at the HTML that is generated to see what is going on; if you examine the source code for your page, you'll see that only the second script is registered. That, combined with reading the documentation, should fully explain to you what is going on.- Jeffhttp://weblogs.sqlteam.com/JeffS |
|
|
vk18
Posting Yak Master
146 Posts |
Posted - 2007-04-24 : 16:52:01
|
Hi,I tried giving different names to this popupscripts but still it is printing only the first one. I want to popup two windows at a time. any Idea..? I have these 2 popupscripts in a function and i am calling this function. Thx popupscript = "<script language='javascript'>" & _ "window.open('invoicerpt.aspx?id=" & Me.txtinvoicenumber.Text & "&t=pdf', 'CustomPopUp', " & _ "'status=yes,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,width=790,height=500')" & _ "</script>" Page.RegisterStartupScript("PopupScript", popupscript) popupscript1 = "<script language='javascript'>" & _ "window.open('InvoiceSummaryReport.aspx?id=" & Me.txtinvoicenumber.Text & "&rid=" & showrates & "&cid=" & showcomm & "&t=pdf', 'CustomPopUp', " & _ "'status=yes,scrollbars=yes,toolbar=yes,menubar=yes,resizable=yes,width=790,height=500')" & _ "</script>" Page.RegisterStartupScript("PopupScript1", popupscript1) |
|
|
cvraghu
Posting Yak Master
187 Posts |
Posted - 2007-04-24 : 18:17:31
|
The second parameter to window.open should be different in two statements. It will be used as the target window. In your case don't use 'CustomPopUp' for both the windows. Use different names. |
|
|
|
|
|
|
|