title: How do I get the browser to open the pdf in a new tab instead of just downloading it?
body: <p>I have a Download button and a View button. The file is downloaded via MVC controller function returning FileResult.</p>
  
  <p>The controller function looks like this:</p>
  
  <pre><code>    public FileResult DownloadStatement(Guid statementID) {
          StatementFileModel statementFile = BL.GetStatementByID(statementID);
          byte[] fileBytes = statementFile.FileData;
          Response.ContentType = "application/pdf";
          Response.AddHeader("Content-Disposition", "attachment;filename=" + statementFile.FileName);
          Response.BinaryWrite(fileBytes);
          return File(fileBytes, "application/pdf");
      }
  </code></pre>
  
  <p>The following works great for downloading the PDF immediately without opening it in the browser:</p>
  
  <pre><code>window.location.href = "/DownloadStatement?statementID=" + statementID;
  </code></pre>
  
  <p>I'm having trouble with the View button though. I tried the following but it also just downloads the PDF without opening it in the browswer:</p>
  
  <pre><code>window.open("/DownloadStatement?statementID=" + statementID, '_blank', 'fullscreen=yes');
  </code></pre>