js
$.ajax({
type: "post",
url: "/Sum/MemberDayCSV",
data: { Date: date, Detail: detail, ConditionDisplay: conditionDisplay },
success: function (eg) {
console.log(eg);
}
});
C#
[HttpPost]
public FileContentResult MemberDayCSV()
{
string csvContent = "1,2,3,4,5,6";
return File(new System.Text.UTF8Encoding().GetBytes(csvContent), "application/csv", "sum_member_day.csv"); ;
}
它应该是下载一个csv文件,但什么也没发生。请帮助我,谢谢你的好意。