how to write excel content type while returning from mvc view

59

how to write excel content type while returning from mvc view -

Response.ContentType = "application/application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";

Response.AppendHeader("content-disposition", "attachment; filename=myfile.xlsx");

how to write excel content type while returning from mvc view -

Response.ContentType = "application/vnd.ms-excel";

Response.AppendHeader("content-disposition", "attachment; filename=myfile.xls");

Comments

Submit
0 Comments