111,094
社区成员




Response.ContentType = "application/vnd.ms-excel";
//设定编码方式
Response.Charset = "gb2312";
Response.ContentEncoding = System.Text.Encoding.UTF7;
//关闭ViewState
EnableViewState = false;
StringWriter tw = new StringWriter();
HtmlTextWriter hw = new HtmlTextWriter(tw);
this.dq_GridView.RenderControl(hw);
//把HTML写回浏览器
Response.Write(tw.ToString());
Response.End();
<meta http-equiv="content-type" content="application/ms-word; charset=UTF-8" />
Response.AddHeader("content-disposition", "inline; filename=" + HttpUtility.UrlEncode("可以是中文", Encoding.UTF8) + ".doc");
Response.ContentType = "application/msword";