日期:2014-05-20  浏览次数:20503 次

IE 中显示 PDF 的问题
Response.Clear();
Response.ClearHeaders();  
Response.ClearContent();  
Response.ContentType   =   "application/pdf ";  
Response.WriteFile(Server.MapPath( "temp ")+ "\\temp.pdf ");  
// HttpContext.Current.Response.ContentType   =   "application/Excel ";  
// HttpContext.Current.Response.WriteFile(Server.MapPath( "temp ")+ "\\temp.xls ");  
Response.Flush();  
Response.End();  
------------------------------------------------------
用以上代码在Page_Load   中进行处理,却无法显示出PDF,
但如果在页面中加一按钮,再调用此方法,却可显示,是什么原因呢?

------解决方案--------------------
看看是否代码没执行到!
------解决方案--------------------
是不是客户端没装Adobe Acrobat Reader

*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)

最新版本:20070212

http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html