All articles| All Pictures| All Softwares| All Video| Go home page| Write articles| Upload pictures

Reading number is top 10 articles
asp.net身份验证(登录控件),基于标准的sqlserver_[Asp.Net教程]
select控件在Mozilla和Opera中的问题_JavaScript技术_编程技术
Asp.net中防止用户多次登录的方法_[Asp.Net教程]
一个读取扩展名为xml的资源文件的方法_.net资料_编程技术
.Net中如何操作IIS(源代码)_[Asp.Net教程]
asp.net,2.0中不同web控件之间的相互调用_[Asp.Net教程]
PHP技巧:PHP程序中文件上传的安全问题_[PHP教程]
ASP.NET,2.0配合MasterPage的优化CSS_[Asp.Net教程]
asp.net身份验证和授权_.net资料_编程技术
Linux下PHP连接MS,SQLServer的办法_php资料_编程技术
Reading number is top 10 pictures
Group of female porn in 《westwards》, uninhibited woman threatened to not the bottom line1
各种囧况!玩游戏最不喜欢出现的十件事(点评)
The money of more than 100 countries and regions8
穷哥们向美女求婚攻略
Men's and women's orgasms
战场废物1
天安门景物系列(一)
中国女孩大胆自拍,显露完美身材
Sora aoi in China1
The real super beauty11
Download software ranking
apache-tomcat-6.0.33
matrix2
Kung.Fu.Panda.2
豪门浪荡史
Red cliff
金山office2007
好色的外科大夫
实战黑客不求人
Boxer Classic video1
Professional killers2 data package
delv published in(发表于) 2014/1/10 6:28:01 Edit(编辑)
ASP.NET技巧:Web导出Word需要添加头文件_[Asp.Net教程]

ASP.NET技巧:Web导出Word需要添加头文件_[Asp.Net教程]

ASP.NET技巧:Web导出Word需要添加头文件_[Asp.Net教程]

这个在asp的时候我是这么做的,但是在asp.net中,还是推荐用现成的对象好,比如


HttpContext.Current.Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename);
HttpContext.Current.Response.Charset = "UTF-8";
HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default;
HttpContext.Current.Response.ContentType = filetype;


//HttpContext.Current.Response.ContentType = "application/ms-excel";//image/JPEG;text/HTML;image/GIF;vnd.ms-excel/msword


System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
gv.RenderControl(hw);


HttpContext.Current.Response.Write(tw.ToString());
HttpContext.Current.Response.End(); 回复


# re: Web导出Word需要添加头文件 2006-08-15 23:50 尧尧
@aspnetx
是的,我也是用现成的,这就是上面我说的,我经常导出EXCEL,那个函数我写在了
Table导出为xls,doc,txt,htm方法
但如果导出WORD,就会出现编码的问题,当添了上面那段,问题就解决了:)


来源:网络







添加到del.icio.us 添加到新浪ViVi 添加到百度搜藏 添加到POCO网摘 添加到天天网摘365Key 添加到和讯网摘 添加到天极网摘 添加到黑米书签 添加到QQ书签 添加到雅虎收藏 添加到奇客发现 diigo it 添加到饭否 添加到飞豆订阅 添加到抓虾收藏 添加到鲜果订阅 digg it 貼到funP 添加到有道阅读 Live Favorites 添加到Newsvine 打印本页 用Email发送本页 在Facebook上分享


Disclaimer Privacy Policy About us Site Map

If you have any requirements, please contact webmaster。(如果有什么要求,请联系站长)
Copyright ©2011-
uuhomepage.com, Inc. All rights reserved.