当前位置:开发者网络 >> 技术教程 >> .NET教程 >> Asp.Net开发 >> 内容
精彩推荐
分类最新教程
分类热点教程
  
DataGrid1导出到Excel.txt
作者:未知
日期:2005-08-31
人气:
投稿:rosanshao(原创)
来源:未知
字体:
收藏:加入浏览器收藏
以下正文:

Response.ContentType = "application/vnd.ms-excel";
Response.Charset = "";
this.EnableViewState = false ;
System.IO.StringWriter sw = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter hw = new HtmlTextWriter(sw);
this.DataGrid1.RenderControl(hw);
Response.Write(sw.ToString());
Response.End();
相关文章: