title: How to run javascript after PDF file Download
body: <p>I download a FILE to PDF , everything works. I show a loading Image before running the process as it can take several seconds or minutes to collect data from DB to make the file .</p>
  
  <pre><code>&lt;p&gt;
      &lt;asp:LinkButton Height="40" OnClientClick="showLoading();"
          OnClick="btnDownload2_Click" runat="server" CssClass="btn btn-success" ID="LinkButton1"
          Text="Click Here to Download List of Registered Students per course"&gt;
          &lt;span style="text-align:center"&gt; Download List&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/span&gt;
          &lt;img id="Img2" style="display:none" src="../../images/ajax-loader.gif" alt="Loading" /&gt;
      &lt;/asp:LinkButton&gt;
  &lt;/p&gt;
  </code></pre>
  
  <p>The issue is when the file gets downloaded how can i change the <code>Img2</code> back to original style. If it was not <code>Resonse.Write</code> it would automatically have switched to original style after button event finished.</p>
  
  <p>This is the file download Process ....(end part)...</p>
  
  <pre><code>Response.Clear();
  Response.ContentType = "application/pdf";
  Response.AddHeader("Content-Disposition", "attachment; filename="+reportName+".pdf");
  Response.Buffer = true;
  Response.Cache.SetCacheability(HttpCacheability.NoCache);
  Response.BinaryWrite(bytes);
  Response.End();
  Response.Close();
  </code></pre>
  
  <p>Any suggestions?</p>