36

I am looking to open one aspx page (test.aspx) in two different popup windows at the same time.

what I have till now second replace first one and page recreate in first.

I think it require more clarification here so,

Basicaly I create a graph and place it in test.aspx, and save that graph as image file. I put a button on test.aspx which linked with stimulsoft report and that report show pdf format of that image. Now if i open with test.aspx it replace the image page. but I want to see both graph and pdf same time. One solution is I create a new blank aspx page to display report but I try avoid to add new page because it is possible to mount report on test.aspx.

The question is just to open a single POPUP window twice on same time, but may be it is posible or not. and each and every popup containing there own dynamic controls and report like mrt.

3
  • 6
    What have you tried? Commented Jan 16, 2013 at 5:13
  • I try to use one aspx page for two different things like one show asp.net controls and second show report. Commented Jan 16, 2013 at 5:24
  • You can use github.com/reduardo7/xpopup Commented Jul 15, 2015 at 12:41

3 Answers 3

67

Change the window name in your two different calls:

function popitup(url,windowName) {
       newwindow=window.open(url,windowName,'height=200,width=150');
       if (window.focus) {newwindow.focus()}
       return false;
     }

windowName must be unique when you open a new window with same url otherwise the same window will be refreshed.

Sign up to request clarification or add additional context in comments.

6 Comments

I already tried that but not working. Thanks Umesh
Add some random value in the end of the url's querystring - var noCache = '&x=' + new Date().getMilliseconds();
I accept that but it still has few issue. But I think that is best one here. Thanks Umesh
You should use eight and width in pixels.
Must provide all three parameters to window.popup to get the actual popup effect. Confirmed on 1/12/2024 on the latest Chrome. Using only 1 or 2 parameters will result in the "additional tab" behavior that I see brought up in the comments. Example: window.open("https://stackoverflow.com", "taget", 'height=300px,width=300px')
|
13

To create a popup you'll need the following script:

<script language="javascript" type="text/javascript">

function popitup(url) {
newwindow=window.open(url,'name','height=200,width=150');
if (window.focus) {newwindow.focus()}
return false;
}


</script>

Then, you link to it by:

  <a href="popupex.html" onclick="return popitup('popupex.html')">Link to popup</a>

If you want you can call the function directly from document.ready also. Or maybe from another function.

7 Comments

thanks but I already place that script in my code. but the difference is i want to open same aspx page in 2 window popup at the same time.
You can give the url of the page and call the function twice
Yes I tryed that but it open in first window again....:(
and the important thing is second time it use to show PDF file.
What do you exactly mean by " it open in first window again"? Can you show a snapshot or something. Iused this script and it worlks fine
|
7

First point is- showing multiple popups is not desirable in terms of usability.

But you can achieve it by using multiple popup names

var newwindow;
function createPop(url, name)
{    
   newwindow=window.open(url,name,'width=560,height=340,toolbar=0,menubar=0,location=0');  
   if (window.focus) {newwindow.focus()}
}

Better approach will be showing both in a single page in two different iFrames or Divs.

Update:

So I will suggest to create a new tab in the test.aspx page to show the report, instead of replacing the image content and placing the pdf.

3 Comments

No I dont face any problem to open this page for my code I don't need to use iFrames or Divs.both are working fine but if i use same page for both, second window open in first window as well but i try to keep first and open report in second page. basicly it is because of url I get the issue but looking for solution. Thankyou Wolf
I think i got your question now. Updated my answer
I am not getting how to create a tab in popup window?

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.