用Asp.net做导出excel和word,但是在360浏览器3.7版上无法使用,在3.6版上则正常
在3.7版上,点击导出excel,会弹出框来,但立马消失,然后就没反应了,这怎么解决?在IE上是好用的
public static void CreateExcel(DataSet ds, string filename, string strType, Page page)
{
page.Response.Clear();
page.Response.Buffer = true;
page.Response.Charset = "GB2312";
page.Response.AppendHeader("Content-Disposition", "attachment;filename=" + filename);//文件名称.doc
page.Response.ContentType = strType; //"application/ms-word"
page.EnableViewState = false;
System.IO.StringWriter swOut = new System.IO.StringWriter();
HtmlTextWriter hTw = new HtmlTextWriter(swOut);
System.Web.UI.WebControls.DataGrid dg = new System.Web.UI.WebControls.DataGrid();
dg.DataSource = ds;
dg.DataBind();
dg.RenderControl(hTw);
page.Response.Write(swOut.ToString());
page.Response.End();
}
这是我的导出方法,在IE上是好用的
在原来的360浏览器3.6版上也是好用的,但用3.7版就不行了,现在我重新安装3.6版也不行了
安全设置我能想到的都启动开了,问题就在于原本3.6版看的时候没问题,升级了3.7就不行了,然后我又卸载了3.7,重新按3.6,结果也不能导出了。。。