title: Close window after Response.End()?
body: <p>I am using the code below to download an Excel file. Once the <code>Response.End()</code> call runs, I want to close window. However, this isn't happening. Please see the code I have so far below.</p>
  
  <pre><code>'Write it back to the client
  
     Dim filename As String = "FullExtract_" &amp; Now.Year.ToString &amp; Now.Month.ToString &amp; Now.Day.ToString &amp; ".xlsx"
     Response.ContentType = "application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
     Response.AddHeader("content-disposition", "attachment;  filename=" &amp; filename)
     Response.BinaryWrite(pck.GetAsByteArray())
     Response.End()
     'cursor not reaching to below code   
     Page.ClientScript.RegisterStartupScript(Me.GetType(), "closedownload", "JavaScript:window.close(); return false;")
  </code></pre>
  
  <p>How do I close the window?</p>