我有一个aspx页面,其中包含一个显示pdf的iframe页面(我在iframe中显示pdf时使用了ashx处理程序),我也有一个下载按钮,它将不同的pdf作为附件。 下载到浏览器的代码(这是ashx的处理程序)IE中的iframe变空白
byte[] bytes = // get byte array from table
Response.Buffer = false;
Response.Clear();
Response.ClearContent();
Response.ClearHeaders();
Response.ContentType = "application/pdf";
// [optional]
Response.AddHeader(
"Content-Disposition",
string.Format("attachment; filename={0}", attachmentName)
);
Response.OutputStream.Write(bytes, 0, bytes.Length);
Response.End();
此代码然而,发送此响应浏览器我的iframe中一片空白,我必须刷新页面才能再次见到它后工作正常。我想大部分的解决方案
但他们没有工作。 iframe在chrome & FF中表现良好。 注意:如果我下载的东西使用asp:超链接到我的ashx和设置目标=“_ blank”它在IE中工作正常,但我需要一些服务器端处理来做,因此我不能使用这种方法。
您使用的是什么版本的IE?你尝试过哪些版本? – Xcalibur37 2011-12-21 01:34:40
我使用IE9 n我试过IE 7,8。 – DotNetUser 2011-12-21 03:17:10