Hi, i want to show PDF in a view in MVC, following function return file
public ActionResult TakeoffPlans(string projID) { Highmark.BLL.Models.Project proj = GetProject(projID); List ff = proj.GetFiles(Project_Thin.Folders.CompletedTakeoff, false); ViewData["HasFile"] = "0"; if (ff != null && ff.Count > 0 && ff.Where(p => p.FileExtension == "pdf").Count() > 0) { ViewData["HasFile"] = "1"; }
ViewData["ProjectID"] = projID;
ViewData["Folder"] = Project_Thin.Folders.CompletedTakeoff;
//return View("UcRenderPDF");
string fileName = Server.MapPath("~/Content/Project List Update 2.pdf");
return File(fileName, "application/pdf", Server.HtmlEncode(fileName));
}
but it display some bad data in view, please help me on this