Print Page | Close Window

Open page in parent window; close popup

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Classic ASP Discussion
Forum Description: Discussion on Active Server Pages (Classic ASP).
URL: https://forums.webwiz.net/forum_posts.asp?TID=4798
Printed Date: 28 March 2026 at 7:54am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Open page in parent window; close popup
Posted By: pedalcars
Subject: Open page in parent window; close popup
Date Posted: 06 August 2003 at 7:34am
I have a main page, default.asp, which includes links which will spawn a pop-up window. In the pop-up there are various options to do various things, like log in, register, etc.

If there is an error (eg on registration the two passwords are different, or blank, or contain forbidden characters) the viewer will be bounced back and asked to correct things. That bit's easy, tick, done.

What I need to do is, when the login (etc) is successful, for the viewer to be taken back to default.asp, but to have this reloaded in the main window while the popup gets closed.

I'm thinking, If (action) OK Then redirect to another page (ok.asp) in the pop-up, which will reload default.asp in the main window then close itself in the pop-up.

I've found (on this forum ) some javascript for doing this when the viewer clicks on a link, but is it possible to do automatically (no clicking requied) and preferably without using JS?

Thanks.

PS. If JS is essential, don't worry, I can always put in an explanation of what a view would have to do if they had JS disabled. But the automatic nature rather than the "click here" solution is more important!

-------------
http://www.pedalcars.info/ - www.pedalcars.info

The most fun on four wheels




Replies:
Posted By: PaulGQ
Date Posted: 07 August 2003 at 12:39pm

I've used this before.

first use meta refresh to get the popup to a page with <onload=self.close()> in the body.

<META HTTP-EQUIV=REFRESH CONTENT="1;URL=AutoClose.asp">

then on the unload event us the following 

<body onUnload="window.opener.location.reload()">

The page closes and updates the parent window.

Just work the parent so it can handle regular then updated material.




Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net