首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

IE 中显示 PDF 的有关问题

2011-12-27 
IE 中显示 PDF 的问题Response.Clear()Response.ClearHeaders()Response.ClearContent()Response.Conte

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

热点排行