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

Strange Popup JS window behavior

P: n/a
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro
llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when
I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth
Nov 18 '05 #1
Share this Question
Share on Google+
6 Replies


P: n/a
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.

I'm wondering if it is a timing thing where the main page is still rendering
its contents and somehow steals back the focus? Maybe there's a delay while
the page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro
llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when
I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


Nov 18 '05 #2

P: n/a
Is there in asp.net any property you can set that tells
the window to stay on top of all other windows?

In JS 1.2 there is a 'alwaysRaised' parameter to
the 'window.open' function, but I can't get that working
either.

/Kenneth
-----Original Message-----
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.
I'm wondering if it is a timing thing where the main page is still renderingits contents and somehow steals back the focus? Maybe there's a delay whilethe page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


.

Nov 18 '05 #3

P: n/a
Perhaps, on this form I call for the JS function with two
calls, one from a button (doesn't work) and one from a
buttoncolumn in a grid (that works).

From the grid's ItemCommand I do:

If e.CommandName = "Change" Then
Page.Register....
End If

and from the Button_Click event I do:

Page.Register...

with identical calls.

What to do?

/Kenneth
-----Original Message-----
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.
I'm wondering if it is a timing thing where the main page is still renderingits contents and somehow steals back the focus? Maybe there's a delay whilethe page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


.

Nov 18 '05 #4

P: n/a
Yes, it was a time delay problem.

I tried to include 'setTimeout' upon calling the JS
function with a delay with 200 ms and it all works just
fine.

/Kenneth
-----Original Message-----
Hey Kenneth,

It works fine on my local machine, outside of the VS.NET environment.
I'm wondering if it is a timing thing where the main page is still renderingits contents and somehow steals back the focus? Maybe there's a delay whilethe page is compiled?

Ken

"Kenneth" <ke***********@chello.se> wrote in message
news:06****************************@phx.gbl...
Hi,

function NewWindow(mypage, myname, w, h, scroll) {
var winl = (screen.width - w) / 2;
var wint = (screen.height - h) / 2;
winprops
= 'height='+h+',width='+w+',top='+wint+',left='+winl +',scro llbars='+scroll+',resizable=0'
win = window.open(mypage, myname, winprops)
if (parseInt(navigator.appVersion) >= 4) {
win.window.focus(); }
}

between <head> tags

Page.RegisterStartupScript("details", "<script
language='JavaScript'>NewWindow
('showDetails.aspx','details',630,200,'yes');</script>")

is the code when I open a popup JS window

In design mode in VS.NET 2003 it works just fine, but when I run it on from my production server the popup window
hides behind the calling window.

Any ideas?

TIA

/Kenneth


.

Nov 18 '05 #5

P: n/a
Glad to hear you made some progress!

"Kenneth" <ke***********@chello.se> wrote in message
news:0c****************************@phx.gbl...
Yes, it was a time delay problem.

I tried to include 'setTimeout' upon calling the JS
function with a delay with 200 ms and it all works just
fine.

/Kenneth


Nov 18 '05 #6

P: n/a
Glad to hear you made some progress!

"Kenneth" <ke***********@chello.se> wrote in message
news:0c****************************@phx.gbl...
Yes, it was a time delay problem.

I tried to include 'setTimeout' upon calling the JS
function with a delay with 200 ms and it all works just
fine.

/Kenneth


Nov 18 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.