Display PDF documents in browser in asp.net.
private void DisplayPDF(string pdfPAth) { string path = pdfPAth; WebClient client = new WebClient(); Byte[] buffer = client.DownloadData(path); if (buffer != null) { Response.ContentType = "application/pdf"; Response.AddHeader("content-length", buffer.Length.ToString()); Response.BinaryWrite(buffer); } }