title: ASP.NET MVC Return File result with additional data to process on client side
body: <p>I'm currently collecting ideas how to solve the following issue: I'm generating Report in realtime and returning it to the browser using the <code>File</code> method.</p>
  
  <pre><code>public ActionResult GenerateReport()
  {
    var report = ... // Don't care, we get an object containing an Id and a byte array
    var reportId = report.Id; // this is actually important
  
    return File(report.Data, "..."); // Return data with some content type, filename etc.
  }
  </code></pre>
  
  <p>When the action is executed, the browser will prompt the file download. But I'd also somehow like to transfer the new <code>Id</code> to the Browser which I need for processing.</p>
  
  <p>Do you have any idea how I could solve this using the common JavaScript (jQuery) and Web/ASP.NET/Ajax or whatever techniques?</p>