Open a new window on top of parent window using script

R

Ralf

Using .NET 1.1, vb code behind.
I have a project and I have been opening new windows throughout it. I
need them opened on top of the parent, and be able to minimize or go
back to the parent if needed before closing the new window. I am
opening the window this way.
Response.Write("<script>window.open('ReviewComments.aspx')</script>")

On the code behind of the new window in the Page_Load function, I keep
the window on top by using this.
RegisterStartupScript("OpenOnTop", "<script
language=javascript>document.focus();</script>")

This has worked great for about 5 other windows. I have went back and
added another window, but it doesn't work everytime. I can sit here
and test it over and over, and sometimes it stays on top but most of
the time it goes to the back. I have checked the properties of the
page against the ones that work and they are identical. Any ideas what
is happening?
I am open to other ways of getting the window to stay on top, so
suggestions are appreciated.
Thx
 
B

bruce barker \(sqlwork.com\)

most likey, the other windw is setting focus. you should stop using popups
as most browsrs will block them. use a floating iframe instead. a good
javscript book will tell you how, so get a control.

-- bruce (sqlwork.com)
 
R

Ralf

On the one parent page, I have a datagrid that has 2 buttons. Each
button opens a seperate window. The one button works great everytime,
this button works about 1 out of 10 times. I don't think the parent is
gaining focus b/c it would be doing so with the other window.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,581
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top