Show pdf in the browser in asp.net mvc
Posted
by Pankaj
on Stack Overflow
See other posts from Stack Overflow
or by Pankaj
Published on 2010-06-09T10:18:31Z
Indexed on
2010/06/09
10:22 UTC
Read the original article
Hit count: 197
asp.net-mvc
I have a tab on my page, when i click on this tab, i need to show a pdf file on page(browser). For this i am writing function on control like this
public ActionResult PricedPdf(string projID,string fileName)
{
byte[] bArr = new byte[] { };
bArr =getdata();
return File(bArr, System.Net.Mime.MediaTypeNames.Application.Pdf, fileName+".pdf");
}
Now my problem is when i render this, page only show some unreadable data not pdf.
© Stack Overflow or respective owner