Wrox Programmer Forums
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old March 23rd, 2005, 12:23 PM
Registered User
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nestor082
Default Modal Dialog (javascript & ASP.NET)

I am using window.showModalDialog method from client code in an ASP.NET Web form to open a modal window. When I try to do some processing in the modal window, it opens up another window displaying the results. Can the results be displayed in the same Modal window itself? How can I avoid this extra window?

Thanks in advance,

Old March 30th, 2005, 05:41 PM
Friend of Wrox
Join Date: Nov 2004
Posts: 1,621
Thanks: 1
Thanked 3 Times in 3 Posts

What is the code that you are using?

One thing you could do (I’m shooting in the dark here somewhat, not knowing exactly what you are doing), is to pass the window to the modal dialog to permit access to the parent's variables, etc.
At the point that you are trying to change the contents of the modal dialog, instead fill in some global variables in the parent, close the modal dialog, then immediately open a new modal dialog with the information that you ‘posted’ back to the parent window.

(Not exactly an answer to what you asked, I know, but viable. Seeing what it is that you are up to would help give a more applicable answer.)
Old March 30th, 2005, 08:38 PM
Registered User
Join Date: Mar 2005
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to nestor082


I already found a solution and I'd like to share it. I'm calling the modal window from javascrit, using:


The problem araised when closing the modal window from server code:

Respose.Write("<script language=javascript>window.close();</script>")

This opened a new browser instance of the parent window. The solution is very simple and I found it in another forum. Just put the following tag in the <head> section of the modal window:

<base target="_self">

That's it.

Thanks and regards

Similar Threads
Thread Thread Starter Forum Replies Last Post
how to return value from modal dialog ajaypsingh Javascript 2 May 16th, 2006 05:14 AM
Modal Dialog window Problem anandham Javascript 7 February 16th, 2005 06:08 PM
Modal dialog window eldanh ASP.NET 1.0 and 1.1 Basics 0 August 10th, 2004 02:07 PM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.