You can answer the page request with the file:
Response.AddHeader("Content-Disposition",
"attachment; filename=yourfile.csv");
Response.ContentType = "text/plain";
Be sure to disable buffering, so IIS may start sending the first part of the file when creating the second:
Response.BufferOutput = false;
After that, you can start recording the file, for example:
Response.Write("field1,field2,field3\r\n");
When the file is completely written, complete the answer, so ASP.NET does not add the web page to your file:
Response.End();
, -, .
, ZIP . ZIP .