怎样把带有排序字段的DATAGRID中的数据导出到EXCEL中呢 土办法:加个隐藏的DataGrid....... 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 Response.AddHeader("Content-Disposition", "attachment; ename=ExcelFile"); Response.Charset = "GB2312"; //我是用这一句来解决的。Response.ContentType = "application/vnd.ms-excel"; EnableViewState= false; System.IO.StringWriter tw = new System.IO.StringWriter(); System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw); this.DataGrid1.RenderControl(hw); Response.Write(tw.ToString()); Response.End(); 你有没有多试几次了呢,我即使在WEB。CONFIG里必为GB2312也还是这样的。 svn提交的时候同时更新web目录文件不成功 各位 大哥哥 大姐姐 给我讲解下索引到底是什么意思 .net有什么图像识别的控件吗 字符串求解析 debug 和release出力文件名如何设置成不一样的名字! 跟踪不进函数 哪个老大来帮帮忙 C# PPC编程问题 谁能教我GUI啊,,在线等待 很菜的问题,C#程序可以在没有装fdk能够运行吗??谢谢 AquaSample按钮,不响应原来的鼠标事件 ▉▉▉win98机器接宽带上网,有时能连上网,有时连不上,网络不通。真是怪了。
Response.Charset = "GB2312"; //我是用这一句来解决的。
Response.ContentType = "application/vnd.ms-excel";
EnableViewState= false;
System.IO.StringWriter tw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new System.Web.UI.HtmlTextWriter(tw);
this.DataGrid1.RenderControl(hw);
Response.Write(tw.ToString());
Response.End();
我即使在WEB。CONFIG里必为GB2312也还是这样的。