我正在使用以下代码将CSV导出到Firefox:
string csv = dataTable.ToCSV();
Response.ClearContent();
Response.AddHeader("Content-disposition", "attachment;filename=solicitud.csv");
Response.AddHeader("Content-length", (Encoding.Unicode.GetBytes(csv).Length).ToString());
Response.ContentType = "application/excel";
Response.ContentEncoding = Encoding.Unicode;
Response.Write(csv);
Response.End();
然而,firefox在下载文件时陷入“启动”状态,我的猜测是firefox一直在等待接收更多字节,这只发生在firefox中,IE工作正常,我错过了标题还是你看错了什么用代码?