How do I best generate a CSV (comma-delimited text file) for download with ASP.NET?

后端 未结 8 1190
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-14 18:46

This is what I\'ve got. It works. But, is there a simpler or better way?

One an ASPX page, I\'ve got the download link...



        
8条回答
  •  无人及你
    2020-12-14 19:27

    There's a lot of overhead associated with the Page class. Since you're just spitting out a CSV file and have no need for postback, server controls, caching, or the rest of it, you should make this into a handler with an .ashx extension. See here.

提交回复
热议问题