Response.ContentType = "text/csv" causes XML error
I've got an odd issue.
I'm creating a DataTable type my application then converting it to a CSV so the user can download the data.
I set the content type like this:
context.Resp开发者_如何转开发onse.Clear();
context.Response.ContentType = "text/csv";
context.Response.AddHeader("Content-Disposition", "attachment; filename=" + fileName + ".csv");
var responseBuilder = new StringBuilder(data.Rows.Count * data.Columns.Count * 30);
Now, this works well for all data sizes in my development environment, and for small amounts of data on my production environment, but when it gets to a larger size (say, more than about 4000 rows) on production Firefox gives me the error:
XML Parsing Error: no element found
Any ideas? There are no errors in Elmah, which I'm using to log.
Thanks in advance!
It was a timeout issue on the Load balancer.
精彩评论