The following returns a PDF which the browser tries to directly display inline. This works correctly. However, if I try to download the file, the download name is not \"myPD
It is possible by making the id a string which represents the file name without the extension.
public ActionResult PDFGenerator(string id, int? docid)
{
Stream stream = GeneratePDF(docid);
return new FileStreamResult(stream , "application/pdf");
}
The url then then end like this
..PDFGenerator/Document2?docid=15