1

Searched around quite a bit for this but can't find an answer.

The following renders the PDF (on button's click event) in the same browser tab:

HttpContext.Current.Response.Clear();
HttpContext.Current.Response.ContentType = "application/pdf";
HttpContext.Current.Response.BufferOutput = true;
HttpContext.Current.Response.AddHeader("Content-Disposition",
    String.Format("{0}; filename={1}.pdf;", "inline", doc.DocNum));
HttpContext.Current.Response.BinaryWrite(buffer);
HttpContext.Current.ApplicationInstance.CompleteRequest();

I'd like the resulting PDF to be opened in a new tab? Can this be done using the above?

MattSull
  • 5,514
  • 5
  • 46
  • 68

1 Answers1

0

I know it have been a long time, but, just for help: I solved my problem (the same as the question), just adding target='_blank' to the form tag.