Response.AddHeader("Content-Disposition", "attachment; filename=test");
//Response.Charset = "UTF-8";
Response.Charset = "Unicode";
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
this.DataGrid.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
//Response.Charset = "UTF-8";
Response.Charset = "Unicode";
Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
this.DataGrid.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
解决方案 »
- silverlight 4的button.content属性不能用
- ajax控件包也加了,怎么找不到Toolkitscriptmanager呢
- ASP.NET 怎么实现新浪微博“大家正在说”功能?
- 怎样绑定DataList控件种ImageButton图像
- 倾家荡产,求一ajax实现的添加数据效果
- 访客发贴间隔时间为 30秒, 设计思路是什么?
- 问一个很有趣的问题 asp很容易解决,asp.net不知如何解决的问题
- CrystalReport登陆失败的问题。100分,在线等。
- Repeater + URL字符串参数实现分页的问题
- 开发好维护的asp.net 后台,需要分层吗?需要用什么框架或技术吗?
- 大家谈谈泛型编程在.net中的影响~~~见者有分~~~:)
- xml与Dataset交互了,但是无法更新到数据库!(~急)
在服务器端生成 Excel文件,然后发送到客户端浏览器(此时需要添加一些 HTTP 头,就像popu2(混口饭吃) 说的那样)。