title: Close current view in ASP.NET MVC
body: <p>I have a page called <code>PayOut.cshtml</code>. On this page, I have a button called <code>Pay</code>, which opens a new small window called <code>Authenticate.cshtml</code> for a user to authenticate himself by specifying his email and password. </p>
  
  <p>Once a user has been authenticated, the the <code>Authenticate.cshtml</code> should be dismissed, and showing a button called <code>Confirm</code> in the <code>PayOut.cshtml</code> page. </p>
  
  <p>I have tried the following: </p>
  
  <pre><code>public AuthenticateController(Authenticate obj)
  {
        var success = false;
  
        if (auth) {
           success = true;
        }
  
        return View("close");
  }
  </code></pre>
  
  <p>View for close:</p>
  
  <pre><code>&lt;body&gt;
      &lt;script type="text/javascript"&gt;
          window.close();
      &lt;/script&gt;
  &lt;/body&gt;
  </code></pre>
  
  <p>How can I dismiss the the authenticate view and show a button in the PayOut view by using session ? Please help.</p>