I am working on a action that returns excel file - the excel is created using ComponentOne dll.
Here is what I have so far
public ActionResult DownloadExcel()
{
C1XLBook testBook = new C1XLBook();
XLSheet s1 = testBook.Sheets[0];
MemoryStream ms = new MemoryStream();
testBook.Save(ms,FileFormat.Biff8);
return File(ms, "application/ms-excel");
}
But I am getting a invalid Json error
On the JS side I have the following code
$.ajax({
contentType: 'application/json, charset=utf-8',
type: "POST",
url: /test/DownloadExcel,
cache: false,
dataType: "json",
success: function (response) {
alert("good");
},
error: function (xhr, ajaxOptions, thrownError) {
alert("error");
}
});
What am I doing wrong?