请问,我做页面上datalist等内容的导出,有的客户端上正常(windows 2003),有的客户端上提示“无法读取”(windows 2000)。
请指点,谢谢!导出代码如下:Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "inline;filename=" + HttpUtility.UrlEncode("下载文件.xls", System.Text.Encoding.UTF8));
请指点,谢谢!导出代码如下:Response.ContentType = "application/vnd.ms-excel";
Response.AddHeader("Content-Disposition", "inline;filename=" + HttpUtility.UrlEncode("下载文件.xls", System.Text.Encoding.UTF8));
Response.Buffer= false;
Response.Charset="GB2312";
//test.xls 下载时的保存默认名称
Response.AppendHeader("Content-Disposition","attachment;filename=test.xls");
Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312");
Response.ContentType = "application/ms-excel";
this.EnableViewState = false;
System.IO.StringWriter oStringWriter = new System.IO.StringWriter();
System.Web.UI.HtmlTextWriter oHtmlTextWriter = new System.Web.UI.HtmlTextWriter(oStringWriter);
//DataGrid1 为控件名
this.DataGrid1.RenderControl(oHtmlTextWriter);
Response.Write(oStringWriter.ToString());
Response.End();