DataGrid1导出到Excel.txt

80酷酷网    80kuku.com

  datagrid|excel
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();













分享到
  • 微信分享
  • 新浪微博
  • QQ好友
  • QQ空间
点击: