Posted on: 10/16/2014 11:43:21 AM | Views : 368

I have a button when i click it should show pdf file in a page and this pdf   location is  in the server.But i m not able to show the pdf file .
Also will it be good if i show the pdf using javascript 
Please suggest 
<div> <asp:Button ID="bttnpdf" runat="server" Text="Click for open PDF" Font-Bold="True" OnClick="bttnpdf_Click" /> </div>

protected void bttnpdf_Click(object sender, EventArgs e) { string FilePath = "";
string file2 = System.Configuration.ConfigurationManager.AppSettings["pdfpath"].ToString(); FilePath = file2 + "test.pdf"; WebClient User = new WebClient(); Byte[] FileBuffer = User.DownloadData(FilePath); if (FileBuffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", FileBuffer.Leng ...

Go to the complete details ...