Solved

showModalDialog web form opens again after closing the ModalDialog window

Posted on 2008-06-22
2
840 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 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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction HTML checkboxes provide the perfect way for a web developer to receive client input when the client's options might be none, one or many.  But the PHP code for processing the checkboxes can be confusing at first.  What if a checkbox is…
Boost your ability to deliver ambitious and competitive web apps by choosing the right JavaScript framework to best suit your project’s needs.
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…

756 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