How can I export an .xlsx file to excel through mvc using chrome. It works for .xls but not .xlsx
Response.ClearContent();
Response.AddHeader("content-disposition", "attachment; filename= Estimate1.xlsx");
Response.ContentType = "application/excel";
StringWriter sw = new StringWriter();
HtmlTextWriter htw = new HtmlTextWriter(sw);
Response.Write(sw.ToString());
Response.End();
and when i open excel file. it show like this. "Excel cannot open file 'FileName.xlsx' because the file format or file extension is not valid."
so much appreciated your help! :)