i have an ashx file that creates a binary csv file for me. i’d like to be able to pass it any generic list.
i know i can put the list in session and then pick it up in the generic handler but will that acceptable under heavy loads?
byte[] csvData = Utility.ToCsv(",", DAL.GetProducts());
context.Response.OutputStream.Write(csvData, 0, csvData.Length);
it would be nice if i can run any query within the handler (instead of hard-coding DAL.GetProducts()). what are some ways to do this?
If the dataset is above the threshold of what can be serialised into QueryString data, I would simply create a HttpHandler which accepts the list as serialised POST data. That way all your ToCsv() handler needs to do is get the list out of the post data and then deserialise it.
Let me know if you need me to elaborate on any of this.