473,396 Members | 2,023 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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 2587
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: James | last post by:
Quick question about closing recordsets and connection objects. We're in the process of rewriting a TON of bad code. None of it is even remotely tabbed properly, it's impossible to read half the...
0
by: Kathy D | last post by:
I have created an mdi parent form with four children. I want to disable closing the four children but allow closing the parent form. I created a FormClosing event on each form. That event tests...
1
by: Chris Bruce | last post by:
In my application I need a way to distiguish between the following events: 1. When a user closes an MDI child window. 2. When the user closes the MDI parent window which subsequently closes the...
4
by: Thorsten Ottosen | last post by:
Dear all, Is it possible to close or hide a parent form? In particular, is it possible to do from the child form itself? Thanks Thorsten
6
by: Barry Gast | last post by:
Hi. I have an MDI Parent form with multiple child windows. When I close the parent form, the Closing events of the children forms are not executing. Do I have to close all the child forms in the...
10
by: Charles Law | last post by:
For some reason, when I click the X to close my MDI parent form, the action appears to be re-directed to one of the MDI child forms, and the parent remains open. I am then unable to close the...
3
by: Sumit | last post by:
HI.. I am having problem ot determine that a parent form is closing or not in my VB.Net code Any help Sumit
3
by: Oenone | last post by:
I'm writing an application with various MDI child forms. In the Closing event of many of the forms, I have code that asks the user whether he is sure he wants to close the form, because it...
2
by: Tom | last post by:
How is the best way to avoid validation when closing a window? For instance, I have a Windows Forms window which has a validation event for a text box. However, if one enters invalid data in then...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.