读书人

代码在调试的时候,可以导出数据,发布之

发布时间: 2012-04-18 15:01:59 作者: rapoo

代码在调试的时候,可以导出数据,发布之后,布置到服务器的之后,不能导出--仅360浏览器

C# code
public static void ToExcelOrWord(Control gvName,string contentType,string fileName){   HttpContext.Current.Response.Clear();   HttpContext.Current.Response.ClearContent();   HttpContext.Current.Response.ClearHeaders();   HttpContext.Current.Response.Charset="GB2312";   HttpContext.Current.Response.Buffer=true;   HttpContext.Current.Response.AppendHeader("Content-Disposition","attachment;filename="+HttpContext.Current.Server.UrlEncode(fileName));   HttpContext.Current.Response.ContentEncoding=System.Text.Encoding.GetEncoding("GB2312");   HttpContext.Current.Response.ContentType=contentType;   gvName.Page.EnableViewState=false;   System.Globalization.CultureInfo myCItrad=new System.Globalization.CultureInfo("ZH-CN",true);   StringWriter stringWriter=new StringWriter(myCItrad);   HtmlTextWriter htmlWriter=new HtmlTextWriter(stringWriter);   gvName.RenderControl(htmlWriter);   HttpContext.Current.Response.Write(stringWriter.ToString());   HttpContext.Current.Response.Flush();   HttpContext.Current.Response.End();}

回复请先测试好~最好是能发布到服务器上再看能不能实现功能!
注:仅仅在只有360浏览器下无法导出,在其他浏览器下一切都正常!如何修改才能将360浏览器和谐了!!!

[解决办法]
我们都不用360
[解决办法]
360用的是ie内核,哪你ie也不行吧
[解决办法]
探讨

引用:

360用的是ie内核,哪你ie也不行吧
ie测试到5都可以导出!!!!

[解决办法]
探讨

引用:

引用:

360用的是ie内核,哪你ie也不行吧
ie测试到5都可以导出!!!!


果断放弃360!

[解决办法]
你可以告诉用户,宁可用ie5。
[解决办法]
最基本的下载不能支持,谁也没有办法。
[解决办法]
360是病毒或者恶意软件。任何软件设计都不能保证用户在有病毒的状态下正常运行。

叫用户安装一款合格的杀毒软件,清除360和它的残留文件,或者干脆重装系统。
[解决办法]
最好不用360浏览器

读书人网 >asp.net

热点推荐