asp.net导出excel乱码?如何解决?
Response.AddHeader("content-disposition","attachment;filename='"+name1+"'.xls");这个保存中...
Response.AddHeader("content-disposition", "attachment; filename='"+name1+"'.xls"); 这个保存中文名字会乱码 该如修改
展开
1个回答
展开全部
curContext.Response.ContentType = "application/vnd.ms-excel";
curContext.Response.ContentEncoding = Encoding.UTF8;
curContext.Response.AddHeader("Content-Disposition", string.Format("attachment;filename={0}", HttpUtility.UrlEncode(Titile.Split('*')[0] + ".xls", Encoding.UTF8)));
追问
错误 1 当前上下文中不存在名称“Titile” C:\Users\wuqi\Documents\Visual Studio 2012\WebSites\WebSite3\Default.aspx.cs 100 111 WebSite3
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询