title: Programmatically close aspx page from code behind
body: <p>What is the best way to close an ASPX page from the code-behind?  </p>
  
  <p>I have a button event handler that I want to close the page after the user has clicked an ASP.NET button on the page.  I have tried to programmatically add a JavaScript method that contains a <code>window.close()</code> command to the <code>OnClientClick</code> event to close the page but it does not work.  The button is also a <code>asp:AsyncPostBoskTrigger</code> for an AJAX Update Panel.</p>
  
  <p>The application uses .NET Framework 3.5.</p>