By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,382 Members | 1,973 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,382 IT Pros & Developers. It's quick & easy.

Open a new window on top of parent window using script

P: n/a
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('ReviewComment s.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

Nov 15 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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)

"Ralf" <ma************@intergraph.comwrote in message
news:11**********************@e3g2000cwe.googlegro ups.com...
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('ReviewComment s.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

Nov 15 '06 #2

P: n/a
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.

Nov 15 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.