Hi Professionals,
i need to view the pdf in the new tab,Using the linkbutton(Note:Not inside my web application,Files is inside my "D:" )
Thanks in advance,
Vasanth.
Know the answer? Post it. Somebody with the same question will find it here.
Sujeet SumanRank #790 · 2.9K reputationPosted Sep 29, 2015, 1:12 AM EDT
string pdfPath = Server.MapPath("~/SomePDFFile.pdf"); //PDF file path on your local system WebClient client = new WebClient(); Byte[] buffer = client.DownloadData(pdfPath); Response.ContentType = "application/pdf"; Response.AddHeader("content-length", buffer.Length.ToString()); Response.BinaryWrite(buffer);Abhishek KumarRank #510 · 4.8K reputationPosted Sep 29, 2015, 1:24 AM EDT
VasanthakumarRank #6,608 · 261 reputationPosted Sep 29, 2015, 1:51 AM EDT
Sujeet SumanRank #790 · 2.9K reputationPosted Sep 29, 2015, 2:00 AM EDT
VasanthakumarRank #6,608 · 261 reputationPosted Sep 29, 2015, 3:02 AM EDT
Pranay Kant10 reputationPosted Sep 29, 2015, 7:38 PM EDT
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questionsTop experts