现在,我正在使用iframe显示我的pdf。这将打开系统中的pdf阅读器以显示pdf。 我想在aspx页面中显示pdf。但是使用iframe。它应该打开一个弹出窗口,但弹出窗口应该是带有关闭按钮的aspx页面
我尝试过使用此代码,但这会在同一个页面中显示代码。我希望aspx页面只是一个关闭按钮的弹出窗口
protected void Button1_Click(object sender, EventArgs e)
{
string FilePath = Server.MapPath("sample.pdf");
WebClient User = new WebClient();
Byte[] FileBuffer = User.DownloadData(FilePath);
if (FileBuffer != null)
{
Response.ContentType = "application/pdf";
Response.AddHeader("content-length", FileBuffer.Length.ToString());
Response.BinaryWrite(FileBuffer);
}
}