我的代码:
[AcceptVerbs(HttpVerbs.Get)]
public ActionResult Export()
{
DataTable table = ListToDataTable();
var rows = table.AsEnumerable().AsQueryable() as IEnumerable<DataRow>;
var output = CreateXlsStream(rows);
return File(output, "application/vnd.ms-excel", "Export.xls");
}
“你想打开还是保存”不显示。我想在执行“return File(output,”application / vnd.ms-excel“,”Export.xls“)后默认显示”你想打开还是保存“;' line.Thanks。
答案 0 :(得分:0)
这应该有效:
Response.AppendHeader("Content-Disposition", "inline; filename=Export.xls");
return File(...