Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Automatically Close Popup window

Status
Not open for further replies.

sheykc

Programmer
Sep 28, 2001
79
US
I'm working with an ASP.NET application. On one of the buttons, I've added javascript to open a popup window that simply says "Please Wait". That window needs to stay open until the processing is done on the .NET webform.

The problem is, how do I close that window automatically? Window.Close doesn't do anything.

Thanks!
 
I THINK, that when you open the window you specify a name for that window so you would use that window name to close it. window.close refers to the current window and you want to close the popup.



Paranoid? ME?? WHO WANTS TO KNOW????
 
Well, I tried that too, based on another thread I found here.

Code:
var owin;
function winopen(PageURL){
owin=window.open(PageURL, 'NewWindow', 'toolbar=no, location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=50,height=50')
		}

then in my .net I issued an owin.close().

That didn't work either.
 
From the SAME page only is the var owin available to you for closing.

All is not lost, however. If you can count on the name of the window being declared in the .open(...) command to always be 'NewWindow' (from your example, above), then in another page [in the JavaScript section], you can try and commandeer that window by including:

Code:
var owin = window.open("about:blank","NewWindow");
owin.close();

'hope that helps.

--Dave


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
O Time, Strength, Cash, and Patience! [infinity]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top