title: Return value of ModalDialog is always undefined
body: <p>For some reason, the value returned by the Modal Dialog box is always "undefined".</p>
  
  <p>My Main page (aspx):</p>
  
  <pre><code>&lt;%@ Page Title="Home Page" Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %&gt;
  
  &lt;html&gt;
  &lt;head&gt;&lt;/head&gt;
  &lt;body&gt;
  
  &lt;script type="text/javascript"&gt;
  
  function openWindows () {
      var getval;
      getval = window.showModalDialog('../WebSite/popups/uploader.htm');
      document.getElementById("Input").value = getval;
     }
  &lt;/script&gt;
  
  &lt;input id="Input" runat="server" /&gt;
  &lt;input type="button" id="Button1" runat="server" onclick="openWindows()" value="Choose Image"/&gt;
  &lt;/form&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>So in this case, the value of getval is always "undefined"</p>
  
  <p>My Dialog Box (HTML) Code:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
      &lt;script type="text/javascript"&gt;
          function ReturnValues() {
              var objfile = document.getElementById("fileup").value
              document.getElementById("TxtInput").value = objfile
              var vReturnValue = document.getElementById("TxtInput").value;
              window.ReturnValue = vReturnValue;
              window.close();
          }
  
      &lt;/script&gt;
  &lt;/head&gt;
  &lt;body&gt;
      &lt;form id="Formuploader" method="post" runat="server"&gt;
          &lt;input id="TxtInput" type="hidden" runat="server" /&gt;&lt;br /&gt;
          &lt;button id="btnSaveImage" runat="server" onclick="ReturnValues()"&gt;Save Image&lt;/button&gt;
      &lt;/form&gt;
      &lt;/body&gt;
      &lt;/html&gt;
  </code></pre>
  
  <p>Here, ReturnValue does have the required value. But as soon as the ModalDialog closes, the getval variable in the main window becomes undefined.</p>
  
  <p>Any help is greatly appreciated.
  Thanks!</p>