링크 버튼을 클릭하면 링크 버튼이있는 gridview가 있습니다. pdf, jpeg, doc처럼 파일을 다운로드 할 수 있지만 링크 버튼을 클릭하면 브라우저 자체가 표시됩니다.브라우저에서 pdf 열기
string pdfPath = Server.MapPath("~/SomePDFFile.pdf");
WebClient client = new WebClient();
Byte[] buffer = client.DownloadData(pdfPath);
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", buffer.Length.ToString());
Response.BinaryWrite(buffer);
는하지만 난 브라우저
이 파일들이 웹 사이트 폴더에 있습니까? 그렇다면 왜 그들과 연결되어 있지 않습니까? – Paddy
http://stackoverflow.com/questions/12974115/to-open-pdf-file-in-iframe – adt