?
Solved

showModalDialog web form opens again after closing the ModalDialog window

Posted on 2008-06-22
2
Medium Priority
?
845 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
[X]
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
2 Comments
 
LVL 19

Accepted Solution

by:
Albert Van Halen earned 500 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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

This article discusses how to create an extensible mechanism for linked drop downs.
Originally, this post was published on Monitis Blog, you can check it here . In business circles, we sometimes hear that today is the “age of the customer.” And so it is. Thanks to the enormous advances over the past few years in consumer techno…
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…
Suggested Courses

718 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