I have a web app that contains a button which brings up a popup window when clicked. It worked just fine in ASP.NET 1.0 (using Studio 2003). But now that I converted my project over to ASP.NET 2.0 (using Studio 2005), my popup window appears, but then immediately hides behind the opener window.
The only way I've found to get around this problem is to put "onload=self.focus()" in the BODY tag of the popup
window - and even then, if I look closely, I can see the popup window appear, immediately go behind the opener window, and then appear again when the 'onload' gets called.
Here's my code ...
Can someone help me figure out why my popup window keeps hiding behind the opener window?
TIA,
Suzanne
The only way I've found to get around this problem is to put "onload=self.focus()" in the BODY tag of the popup
window - and even then, if I look closely, I can see the popup window appear, immediately go behind the opener window, and then appear again when the 'onload' gets called.
Here's my code ...
Code:
Dim popUp as String = "myurl.aspx"
Dim script as String = ""
script += "<script language='Javascript' id='PrevOrders'>"
script += "var confirmWin = null;"
script += "var screenX = window.screen.availWidth/2 - 400;"
script += "var screenY = window.screen.height/2 - 300;"
script += "confirmWin = window.open('" + popUp + "', 'PrevOrders', 'width=550, height=150, left=' + screenX + ', top=' + screenY + ',status, scrollbars=no, menubar=yes');"
script += "if((confirmWin != null) && (confirmWin.opener==null)) {"
script += " confirmWin.opener = self;"
script += "}"
script += "</script>"
If ClientScript.IsStartupScriptRegistered("popUp") = False Then
ClientScript.RegisterStartupScript(Me.GetType, "test", script)
End If
Can someone help me figure out why my popup window keeps hiding behind the opener window?
TIA,
Suzanne