I need to create an ActionResult in an ASP.NET MVC application which has a .csv filetype.
I will provide a \'do not call\' email list to my marketing partners and i
The answer you accepted is good enough, but it keeps the content of the output in memory as it outputs it. What if the file it generates is rather large? For example, when you dump a contents of the SQL table. Your application could run out of memory. What you do want in this case is to use FileStreamResult. One way to feed the data into the stream could be using pipe, as I described here