asp.net mvc 2 - Display PDF in Html -
I want to show the PDF in a scene in MVC, following the function return file
Public Action Rachel Takeoff Plans (String Projed) {Highmark. Bl.models.projectproject = gateproject (progeid); & Lt; File & gt; Ff = proj.GetFiles (Project_Thin.Folders.CompletedTakeoff, Incorrect); ViewData ["HasFile"] = "0"; If (FF! = Null & amp; FF.Count> 0 & amp; amp; FF. Where (P = & gt; P. File Extension == "PDF") Calculation ()> 0) { ViewData ["HasFile"] = "1"; } ViewData ["ProjectID"] = Prozed; ViewData ["folder"] = Project_Thin.Folders.CompletedTakeoff; // Return View ("UCRandDDDF"); String filename = Server.MapPath ("~ / content / project list update 2. pdf"); Return file (filename, "app / pdf", server.HTMLncode (filename)); }
But it shows some bad data in view, please help me at
Will the following controller method work for you? I am currently using this control method to create downloadable resumes on my site.
public fileResult DownloadResumePdf () {string filename = Server.MapPath ("~ / content / Downloads / Resume.pdf"); Return file (filename, "app / pdf", "resume.pdf"); }
Comments
Post a Comment