title: Exporting Excel File to View (MVC)
body: <p>I have to Export Data to View as Excel , Actually I have Implemented,but my doubt is when 
  to use</p>
  
  <pre><code>return new FileContentResult(fileContents, "application/vnd.ms-excel");
  </code></pre>
  
  <p><strong>vs</strong></p>
  
  <pre><code>return File(fileContents, "application/vnd.ms-excel");
  </code></pre>
  
  <p>and How can set Downloadable Filename in each of this methods?</p>
  
  <p>Example 1:</p>
  
  <pre><code>public ActionResult ExcelExport()
  {
     byte[] fileContents = Encoding.UTF8.GetBytes(data);
     return new FileContentResult(fileContents, "application/vnd.ms-excel");
  }
  </code></pre>
  
  <p>Example:2</p>
  
  <pre><code>public ActionResult ExcelExport()
  {
     byte[] fileContents = Encoding.UTF8.GetBytes(data);
     return File(fileContents, "application/vnd.ms-excel");
  }
  </code></pre>