469,648 Members | 1,410 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,648 developers. It's quick & easy.

closing parent after pop up appears

hi

I open a pop up window using window.showModalDialog. How can I close the
parent window after the pop up appears ?
Nov 17 '05 #1
6 2458
window.showModalDialog(...)
window.close();

will first launch your window, then close itself....

"sramruttun" <sr********@yahoo.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
hi

I open a pop up window using window.showModalDialog. How can I close the
parent window after the pop up appears ?

Nov 17 '05 #2
Check out this article, here i have explained how you can close the popup
window
http://www.microsoft.com/india/msdn/...ndarinASP.aspx

--
Saravana
Microsoft India Community Star,MC**
www.ExtremeExperts.com

"sramruttun" <sr********@yahoo.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
hi

I open a pop up window using window.showModalDialog. How can I close the
parent window after the pop up appears ?

Nov 17 '05 #3
Hi

You cant close the opener if you use a dialog until the dialog closes
use window.open instead.....

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"sramruttun" <sr********@yahoo.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
hi

I open a pop up window using window.showModalDialog. How can I close the
parent window after the pop up appears ?

Nov 17 '05 #4
thanks everyone for your replies
Daniel said:
window.showModalDialog(...)
window.close();
well I had tried this but it does not work..

Saravana is suggesting an article on how to close the POP UP WINDOW while I
want to close the parent (opener)

Vidur said that the opener can't be closed if you use a dialog until the
dialog closes
use window.open instead.....

I too thought that when showModalDialog is used, the parent can't be closed.
I'll need to use window.open.

But is there still a workaround to achieve it using showModalDialog?


"sramruttun" <sr********@yahoo.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
hi

I open a pop up window using window.showModalDialog. How can I close the
parent window after the pop up appears ?

Nov 17 '05 #5
ok Jerry
But what's the main difference between showModelessDialog and
showModalDialog ?
Both seem to be modal.

"Jerry III" <je******@hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
No there isn't, you can't close a window from a modal dialog it owns since
the parent doesn't process user input until the modal dialog closes (that's the difference between modal and modeless dialog). You should be able to use showModelessDialog instead of window.open if you want to.

Jerry

"sramruttun" <sr********@yahoo.com> wrote in message
news:eM*************@tk2msftngp13.phx.gbl...
thanks everyone for your replies
Daniel said:
window.showModalDialog(...)
window.close();
well I had tried this but it does not work..

Saravana is suggesting an article on how to close the POP UP WINDOW
while I
want to close the parent (opener)

Vidur said that the opener can't be closed if you use a dialog until the
dialog closes
use window.open instead.....

I too thought that when showModalDialog is used, the parent can't be

closed.
I'll need to use window.open.

But is there still a workaround to achieve it using showModalDialog?


"sramruttun" <sr********@yahoo.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
hi

I open a pop up window using window.showModalDialog. How can I close the parent window after the pop up appears ?



Nov 17 '05 #6
Hi

http://msdn.microsoft.com/library/de...lessdialog.asp
The dialog will close when opener closes.... use window.open ;-)

--
Best Regards
Vidar Petursson
==============================
Microsoft Internet Client & Controls MVP
==============================
"sramruttun" <sr********@yahoo.com> wrote in message
news:ub**************@TK2MSFTNGP10.phx.gbl...
ok Jerry
But what's the main difference between showModelessDialog and
showModalDialog ?
Both seem to be modal.

"Jerry III" <je******@hotmail.com> wrote in message
news:ee**************@TK2MSFTNGP10.phx.gbl...
No there isn't, you can't close a window from a modal dialog it owns since
the parent doesn't process user input until the modal dialog closes

(that's
the difference between modal and modeless dialog). You should be able to

use
showModelessDialog instead of window.open if you want to.

Jerry

"sramruttun" <sr********@yahoo.com> wrote in message
news:eM*************@tk2msftngp13.phx.gbl...
thanks everyone for your replies
Daniel said:
window.showModalDialog(...)
window.close();
well I had tried this but it does not work..

Saravana is suggesting an article on how to close the POP UP WINDOW

while
I
want to close the parent (opener)

Vidur said that the opener can't be closed if you use a dialog until the dialog closes
use window.open instead.....

I too thought that when showModalDialog is used, the parent can't be

closed.
I'll need to use window.open.

But is there still a workaround to achieve it using showModalDialog?


"sramruttun" <sr********@yahoo.com> wrote in message
news:eZ**************@TK2MSFTNGP12.phx.gbl...
> hi
>
> I open a pop up window using window.showModalDialog. How can I close

the > parent window after the pop up appears ?
>
>



Nov 17 '05 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

4 posts views Thread by James | last post: by
reply views Thread by Kathy D | last post: by
1 post views Thread by Chris Bruce | last post: by
4 posts views Thread by Thorsten Ottosen | last post: by
6 posts views Thread by Barry Gast | last post: by
reply views Thread by gheharukoh7 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.