TestPDF obj = new TestPDF { Employee = new Employee { EmpNo = 10, Name = "Gopi" } }; var javaScriptSerializer = new System.Web.Script.Serialization.JavaScriptSerializer(); string jsonString = javaScriptSerializer.Serialize(obj); framePdf.Src ="http://localhost:56336/Home/Test?pdfData=" + HttpUtility.UrlEncode(jsonString);
[HttpGet] public ActionResult Test(TestPDF pdfData) { byte[] bytes = System.IO.File.ReadAllBytes(@"C:\Test.pdf"); return new FileContentResult(bytes, "application/pdf"); }
I tried in client side programming using $.Post() and $.ajax() method to call the controller action but getting a response like some raw data of filecontent. so do not know how to put this into iframe control.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)