title: how to close popup window from asp.net mvc
body: <p>I want to close some html popup windows. I have static site, which creates popup windows. These windows have a submit button, which sends a POST request to asp mvc app. This app works well and return View() (Index page with message &quot;Ok&quot;. And Button &quot;Close&quot;).</p>
  <p>When I click on Close button- nothing happens.</p>
  <p>My code:</p>
  <pre><code>  &lt;body&gt;
      &lt;button type=&quot;button&quot; id=&quot;btn&quot; onclick=&quot;window.parent.jQuery('#btn, #m_window').hide('slow');&quot;&gt;Close&lt;/button&gt; 
  
     
  &lt;!--   &lt;button type=&quot;button&quot; id=&quot;btnFoo&quot; onclick=&quot;$(&quot;#btnFoo, #m_frame&quot;).live(&quot;click&quot;, function(){
      $(&quot;#mistake&quot;).remove();
  });  &quot;&gt;Close form &lt;/button&gt;
     --&gt;
  &lt;/body&gt;
  </code></pre>
  <p>m_frame- frame of popup window.
  mistake- div of popup window.</p>
  <p>Please, tell me how to close this popup window?</p>
  <p><code>window.close()</code> doesn't work.</p>
  <p>P.S. at js script (when popup creates) I write:</p>
  <pre><code>$(&quot;#btn&quot;,#m_window&quot;).live(&quot;click&quot;,function(){
  var p = parent;
   var win = p.document.getElementById('mistake');
   win.parentNode.removeChild(win);
  });
  </code></pre>
  <p>But it doesn't works too.</p>