处理方法
1.在前台页面▲加上 。
2.在后台强制下转换编码格式
protected void ExportToExcel_Click(object sender, EventArgs e)
{
BindExportData();
string attachment = "attachment; filename = MarkdownPerformanceOfAllSkuReport.xls";
Response.ClearContent();
Response.AddHeader("content-disposition", attachment);
StringWriter stringWriter = new StringWriter();
HtmlTextWriter htmlTextWriter = new HtmlTextWriter(stringWriter);
ResultTable.RenderControl(htmlTextWriter);
Response.ContentType = "application/ms-excel";
Response.Write("<meta http-equiv=Content-Type content=\"text/html; charset=utf-8\">");
Response.Write(stringWriter.ToString());
Response.End();
}