title: After download fire javascript
body: <p>I have an asp.net application where I am trying to write out a csv.  Once the dialog has displayed or after makes no difference, i simply want to display some message stating all went well.  I am trying to fire some javascript to simply change a style of an element as well as some test to show that the download was successful.  </p>
  
  <p>The download works fine and this is how I am doing it but also believe this is what is causing my issue:  </p>
  
  <pre><code>       Response.Clear();
          Response.Buffer = true;
          Response.AddHeader("content-disposition", "inline; filename=myFile.csv");
          Response.Charset = "";
          Response.ContentType = "text/csv";
  
          FileInfo fileToDownload = new FileInfo(filename);
  
          Response.WriteFile(filename);
          Response.Flush();
          HttpContext.Current.ApplicationInstance.CompleteRequest();
          Response.End();
  System.Web.UI.ScriptManager.RegisterStartupScript(this, this.GetType(), "s_DisplayLongRunningQueryComplete", "DisplayLongRunningQueryComplete();", true);
  </code></pre>
  
  <p>If i move the last line where I am registering the startup script to its own button lets say I don't have any issues and it works just fine.  I have tried moving this to before the above fires too with no luck.  </p>
  
  <p>Anyone have any ideas how to make this work?  </p>
  
  <p>Thanks.</p>