this.DataGrid1.AllowPaging=false;
 Bind(DataGrid1,"select * from [work]");
  Response.Clear();   
  Response.Charset="utf-8";    //输出
  string Title = this.Title.Text;
  Response.AppendHeader("Content-Disposition","attachment;filename="+System.Web.HttpUtility.UrlEncode(Title)+".xls");    
  Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312");   //设置输出编码
  System.IO.StringWriter   osw=new System.IO.StringWriter();//new   System.IO.StringWriter(myinfo);   
  System.Web.UI.HtmlTextWriter   ohtw=new   System.Web.UI.HtmlTextWriter(osw);   
  DataGrid1.RenderControl(ohtw);  
  Response.Write(osw);   
  Response.End();

相关文章:

  • 2022-02-11
  • 2021-08-20
  • 2021-05-18
  • 2022-12-23
  • 2021-09-30
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-09-27
  • 2022-12-23
  • 2021-11-02
  • 2021-07-05
相关资源
相似解决方案