Forum Moderators: open

Message Too Old, No Replies

How to focus a popup window from another asp page?

         

srivalli9

3:21 pm on Dec 30, 2003 (gmt 0)

10+ Year Member



Hi .
I have 3 asp pages.
A link in the first one creates a popup window.
A link in the popup window opens a page with 2 frames in it, top and bottom.
Now, I have a link in bottom frame of this page, which, when clicked , should give focus to the existing popup window.

When creating the popup window, I used a reference to it like...
newwin=window.open("",...)

I tried to pass this newwin as QUERYSTRING to all other ASP pages.
And in the last page, i.e.,bottom frame page, I used the code like..
popup.focus() ---------- *
where popup is set to querysttring variable.... Request.QueryString("popupwindowreference")

The above procedure didnt work. it thows an error like...popup is undefined at line *

Can anyone figure out what the problem is?
Any help is grately appreciated!

Thanks you.
-Srivalli.

webkid

3:39 pm on Dec 30, 2003 (gmt 0)

10+ Year Member



hi...

you may try:

newwin.focus();

webkid

srivalli9

4:09 pm on Dec 30, 2003 (gmt 0)

10+ Year Member



thnaks webkid for your reply, but unfortunately, it threw an error...
newwin is undefined.
it is bcos, the opener is refreshed with another page and hence lost the track of the child window.

is there any other way out?

Thanks for the help.

webkid

4:58 pm on Dec 30, 2003 (gmt 0)

10+ Year Member



Sorry about that...

mm.. 3 asp pages.. correct me if wrong...

page 1 -> after click -> window pop up -->page 2?

page 1, did you use the jsript to built it?

if like... Popup(url,name,width,heigh){bla, bla...}
popupWin = window.open(url, name,....);

then iside the body, the button when click,

....button's href="javascript:Popup(url, name, width,
height);"

then inside the page2,

can target the button's value as the same window.

I thought QueryString from ASP using the URL as ("Page1.asp?id=xx&name=abc")to the page2

If you have the form inside the page1.asp, you also can do: Request.QueryString('name')

Sorry again, hope this help. Also, remeber the Javascript and VBScript a bit different. I am not sure if VBScript can call JScript's object thou..

webkid

srivalli9

5:14 pm on Dec 30, 2003 (gmt 0)

10+ Year Member



Thanks for your help, webkid.

The popup is indeed using a javascript as u mentioned.

I did get my code working.
In the frame,bottom, I tried to popup another window with the same name as the previous popup window.
As a window with that name already exists, it activated the existing window, instead of creating a new one.

This is all I wanted!

Thanks a lot for the information you provided, though!

-Srivalli.

webkid

6:00 pm on Dec 30, 2003 (gmt 0)

10+ Year Member



ok :)

Good to hear that.

webkid