Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

showModalDialog web form opens again after closing the ModalDialog window

Posted on 2008-06-22
2
839 Views
Last Modified: 2010-05-18
I'm opening a ModalDialog .aspx page (SaveNewDialogWindow.aspx) and setting the returnValue property to store info entered into the controls on that page.   After the ModalDialog window closes, a new window re-opens displaying the same SaveNewDialogWindow.aspx page, but just a new window with none of the features in the original ModalDialog .aspx page.  Can anyone tell me what I'm doing wrong?

Javascript function from the calling page that opens the ModalDialog .aspx page:

    function SaveTemplate()  
    {            
            var returnValue = window.showModalDialog("SaveNewDialogWindow.aspx","","dialogHeight:100px;dialogWidth:280px;status:no");
            return false;        
    }


Javascript function from SaveNewDialogWindow.aspx that sets the returnValue of the window:
function ReturnValue(button)
{
    window.returnValue = "Cancel";
    if (button == "OK")
    {    
        window.returnValue = "OK|" + document.getElementById("chkDefault").checked + "|" + document.getElementById("txtTemplateName").value;                 
      }
      else
      {
          window.returnValue = button;
      }
      window.close()
}


0
Comment
Question by:trebems
2 Comments
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 125 total points
ID: 21841871
The problem is submutting the form in a modal dialog.
ASP.NET doesn't handle it correctly.

In order to fix this, put this in the head of your html
<BASE TARGET="self">
0
 

Author Comment

by:trebems
ID: 21847237
That did it!  Thanks!
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In Part 1 (http://www.experts-exchange.com/Programming/Languages/Scripting/JavaScript/A_7849-Hex-Maze.html) we covered the hexagonal maze basics -- how the cells are represented in a JavaScript array and how the maze is displayed.  In this part, we'…
Having worked on larger scale sites, we found out that you are bound to look at more scalable solutions to integrating widgets, code snippets or complete applications and mesh them into functional sites, in any given composition. To share some of…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)
The viewer will learn the basics of jQuery including how to code hide show and toggles. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question