I\'m using MVC 3 I would like to dynamically create a CSV file for download, but I am unsure as to the correct MVC orientated approach.
In conventional ASP.net, I wo
I have found one possible solution to this problem. You can simply define the action method to return an EmptyResult() and write directly to the response stream. For example:
public ActionResult RobotsText() {
Response.ContentType = "text/plain";
Response.Write("User-agent: *\r\nAllow: /");
return new EmptyResult();
}
This seems to work without any problems. Not sure how 'MVC' it is...