Popup window appears behind opener window in v2.0

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' got called.

Here's my 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 + </p> <p>', top=' + screenY + ',status, scrollbars=no, menubar=yes');"
script += "if((confirmWin != null) &amp;&amp; (confirmWin.opener==null)) {"
script += " confirmWin.opener = self;"
script += "}"
script += "&lt;/script&gt;"

If ClientScript.IsStartupScriptRegistered("popUp") = False Then
&nbsp; ClientScript.RegisterStartupScript(Me.GetType, "test", script)
End If

Can someone help me figure out why my popup window keeps hiding behind the opener window?


12/12/2005 8:29:11 PM
asp.net.web-forms 93655 articles. 6 followers. Follow

0 Replies

Similar Articles

[PageSpeed] 23
Get it on Google Play
Get it on Apple App Store


Similar Artilces:

how to open popup window through javascript in code behind( popup window should be aligned center)
I want to use javascript in code behind to open popup window. I have Datalist inside which there is linkbutton. On click of linkbutton open popup window through javascript & that pop up window should be aligned centraly.Regards,Mahesh--------------------click "Mark as Answer" on the post that helps you. Friend, Try this sample . <html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server">    <title>Untitled Page</title>        <style>    .blue{ bac...

How to send value form popup window to opener window ??
I have problem and I need everybody help me. I desgning a website using ASP.NET and VB.NET - I want, when user click button as show popup window with list user of system (from database) and click user of list, it's in textbox of opener window. Can you help me code it ??? Thanks a lot !!!  Không học không biết, học rồi sẽ biết  You have to access the window.opener.document object in JavaScript. This will give you access to the DOM. function getOpenerElem(Jb) { return window.opener.document.getElementById(Jb); }  I use this function to access the opening window...

Open Popup Window and Close the window that Opened it
I'm using some code that I found on this site to open a Popup window with a Button Click for a Crystal Report: Dim PopUpScript As String = "<script language='javascript'>" + "window.open(" & Chr(39) & strExportFile & Chr(39) & ");</script>" Page.ClientScript.RegisterStartupScript(Me.GetType(), "PopUpWindow", PopUpScript, False) After the Popup Window shows the Report I would like to close the window that opened this popup window.  Thanks, Mark just add window.close(); in Dim PopUpScript As String ...

Modal Popup window opens new window when form posted
I am having trouble with modal dialog.  I have a web page PopupTestParent.aspx and popup.aspx.  When I click button on popupTestParent.aspx, it opens modal dialog as exptected, when I click button on Popup.aspx, and form gets posted, it opens a new window, instead of using same window as the form.  code for both pages is given below.. Any clue, how to get over this? <%@ Page Language="C#" AutoEventWireup="true" CodeFile="PopupTestParent.aspx.cs" Inherits="PopupTestParent" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 ...

open a popup window from.net code behind
Hi I am trying to open a new window from a button in my aspx side. This works, but I have to push the button 2 times before it open. Any idea? Public Shared Sub OpenPopUp(ByVal opener As System.Web.UI.WebControls.WebControl, ByVal PagePath As String) Dim clientScript As String 'Building the client script- window.open clientScript = "window.open('" & PagePath & "')" 'register the script to the clientside click event of the opener control opener.Attributes.Add("onClick", clientScript) End Sub Sub Button1_Click(sender As...

Popup Window (window.opener)
Hi, I have an ASP.NET application. On one of my pages I have a link to a popup. This popup has a link. When the user clicks this link my popup closes and another Popup is displayed. In this second Popup I want to redirect the user to a fifferent page in my application when the popup closes. Is this possible as another popup opened this second popup so I cannot use 'window.opener'. Any advice is much appreciated. Thanks, C can you please explain a bit more clearly, what I got is that you hae total 4 windows isn't it? are you using hyperlink control or window.openfeed...

superreview granted: [Bug 263844] Javascript window.close() on popup not working when popup is opened in tab : [Attachment 162257] set opener on opened windows diverted into tabs
Boris Zbarsky <bzbarsky@mit.edu> has granted Boris Zbarsky <bzbarsky@mit.edu>'s request for superreview: Bug 263844: Javascript window.close() on popup not working when popup is opened in tab https://bugzilla.mozilla.org/show_bug.cgi?id=263844 Attachment 162257: set opener on opened windows diverted into tabs https://bugzilla.mozilla.org/attachment.cgi?id=162257&action=edit ------- Additional Comments from Boris Zbarsky <bzbarsky@mit.edu> r+sr=bzbarsky. Dan, thanks for doing this! I really wish we could factor some of this code that's being copied f...

More than one page posts using window.opener.window.document.forms[0].submit();
 I've wasted an afternoon and evening trying to find a solution to this weird problem. I have a preview page(default.aspx) and an edit page (editdefault.aspx) as content pages within nested master pages. They are also within an iframe which is not within the nested masters. There are lots of other pages within the top level master page.I use a dynamically created asp:linkbutton to post from default.aspx to editdefault.aspx: Code behind:              LinkButton EditBtn = new LinkButton();      &...

superreview granted: [Bug 297541] Using window.open to open a window at (0,0) does not work : [Attachment 186289] fix?
Boris Zbarsky <bzbarsky@mit.edu> has granted Robert O'Callahan (Novell) <roc@ocallahan.org>'s request for superreview: Bug 297541: Using window.open to open a window at (0,0) does not work https://bugzilla.mozilla.org/show_bug.cgi?id=297541 Attachment 186289: fix? https://bugzilla.mozilla.org/attachment.cgi?id=186289&action=edit ...

superreview requested: [Bug 297541] Using window.open to open a window at (0,0) does not work : [Attachment 186289] fix?
Robert O'Callahan (Novell) <roc@ocallahan.org> has asked Christopher Blizzard <blizzard@mozilla.org> for superreview: Bug 297541: Using window.open to open a window at (0,0) does not work https://bugzilla.mozilla.org/show_bug.cgi?id=297541 Attachment 186289: fix? https://bugzilla.mozilla.org/attachment.cgi?id=186289&action=edit ...

open popup window with click on image and datalist in popup window
 I have a picture,i want to when i click on it a popup window open,in that pop up window i want to have a data list that in every field of it be a link and a picture,when user click on a link with a url go to another website in that pop up window,how can I do this senario? Where are you having a problem? We can't build the thing for you. Post the code that you have so far. NC...    I want when I click on a picture a popup window open Like this? <img src="yourImageFile.jpg" onclick="window.open('Page2.aspx');" /> See http://www.ja...

window.open and window.opener
Sorry for a really dumb post. I am not a scripting person... I find the whole thing a bit strange really with losely coupled types ect...Anyway, I am putting together a ASP.NET v2 application. One of the pages I am planning on implementing a link to open a pop-up window. In this popup window, the user will select the location of somthing, the window close and the value returned back to one of the parent browsers controls. I know this is not rocket science and I have done endless searches to try and find the answer. I am loading up the page and passing in the ClientID of the control I wish to...

Can window.open add a parameter to set up popup windows as a modal windows?
Can window.open add a parameter to set up popup window as a modal window? I want to open modal popup window to display a image. Try this..  window.showModalDialog("http://localhost/Test.aspx", "center:yes;resizable:no;dialogHeight:300px");My Blog"Don't be afraid to be wrong; otherwise you'll never be right." Hi, Do you want to show images? try this alternative: http://www.huddletogether.com/projects/lightbox/ Any doubt, post your comment.Segundo Serrano P.Ing. Sistemashttp://www.4workgroup.com/Blog: http://dotnet-peru.blogspot.com  ...

msg in output window --C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Vbc.exe /noconfig /imports:Microsoft.VisualBasic,System,System.Collections,System.Collections.Generic,System.Data,System.Diagnostics,System.Collections.Specialized,System.Configuration,System.Text,System.Text.RegularExpressions,System.Web,System.Web.Caching,System.Web.SessionState,System.Web.Security,System.Web.Profile,System.Web.UI,System.Web.UI.WebControls,System.Web.UI.WebControls.WebParts,System.Web.UI.HtmlControls /nowarn:41999,42016,42017,42018,42019,42020,42021,42022,42030,42032,42036,42104,42105,42106,42107,42108,42109 /rootnamespace:test...

Web resources about - Popup window appears behind opener window in v2.0 - asp.net.web-forms

‘Promote Your Page’ Button Appears On Some Facebook Pages
Some Facebook page administrators are seeing messages in the top-right-hand corners of their timeline pages urging them to create Facebook ads ...

Jessica Bennett - Dear What Appears to Be My Entire... - Facebook
Dear What Appears to Be My Entire Facebook Feed: Want to clarify previous Lean In post. This was MY post, on MY feed, looking for a volunteer ...

Facebook Connect Appears on MySpace Video Site
You can now access MySpace’s Fan Video site via Facebook Connect, the first integration that we’ve seen between Facebook and MySpace, although ...

A Path Appears (@APathAppears) on Twitter
Log in Sign up You are on Twitter Mobile because you are using an old version of Internet Explorer. Learn more here A Path Appears @ APathAppears ...

Stop the Presses: A New Media Baron Appears
Shareholder Letters Shed Light on Jeff Bezos&rsquo; Approach to BusinessWord that Amazon Founder and CEO Jeff Bezos is buying The Washington ...

Schoolgirl appears bored by Cameron - YouTube
Six-year-old schoolgirl rests her head on a desk as David Cameron encourages her to read during his general election campaign trail - but it ...

Bieber appears on Dubai stage 2 hours late for a second day in a row
The 19-year-old singer, who was meant to start his show at 8pm, finally began at 10pm - this time to a crowd half the size of Saturday's turnout. ...

Party room appears to have already decided Tony Abbott's fate
Many Coalition MPs seem to accept a change in leadership is inevitable, but are unwilling to trigger it themselves.

Mitchell Johnson video: Retirement appears close after poor showing in second Test against New Zealand ...
SPECULATION intensified last night that an emotional Mitchell Johnson is on the brink of retirement.

SpaceX appears poised to launch its first national security payload
A Falcon 9 launch in March, 2015. (credit: SpaceX) United Launch Alliance (ULA) has declined to bid on the launch of a next-generation GPS satellite, ...

Resources last updated: 11/24/2015 12:41:06 AM