将你要输出的内容放在asp:panel标签内,

 

StringWriter tw =new StringWriter(); HtmlTextWriter hw =new HtmlTextWriter(tw); this.pan_content.RenderControl(hw); System.Web.HttpResponse response = System.Web.HttpContext.Current.Response; response.Clear(); response.ContentEncoding = System.Text.Encoding.GetEncoding("gb2312"); response.ContentType ="application/vnd.ms-word"; response.AddHeader("Content-Disposition", "attachment; filename="+ Server.UrlPathEncode(Server.UrlDecode(this.lbtitle.Text) +".doc")); //response.Charset = "utf-8"; response.Write(tw.ToString()); response.End();

相关文章:

  • 2022-12-23
  • 2022-02-03
  • 2022-12-23
  • 2022-12-23
  • 2022-01-19
  • 2021-05-27
  • 2022-12-23
猜你喜欢
  • 2021-12-09
  • 2022-12-23
  • 2021-12-05
  • 2022-02-09
  • 2021-07-10
  • 2021-10-04
  • 2022-12-23
相关资源
相似解决方案