Here's my scenario: 1) User runs search to retrieve values for display in ListView via LinqDataSource. 2) They click on one of the items which takes them to another page where the details can be examined, further drill-down can happen, etc. 3) User wants to go back to the original ListView results to select another item for inspection.
I can see it's possible to pass the querystring params around, allowing the querying to be duplicated each time the user comes back to the ListView, but it seems like there ought to be a way to cache the results.
Since I'm using the LinqDataSource, though, I believe the actual results are fetched each time the query is run. I'm currently feeding a "select new {blah, blah}" type of IEnumerable to the e.Results, which can't be turned into a List since it's populated with anonymous types.
In short: 1) Does it make sense to try to place potentially large query results in the users session? 2) If it does, is a List the reasonable data structure? 3) Do I need to resort to something like creating a class with the correct properties to hold the anonymous data, enumerate the query return, populate the List? 4) Is there a better option than the LinqDataSource for this type goal? 5) Or, does it just make more sense to run the query each time they hit the ListView?
I apologize if this wasn't clear. I would really appreciate it if someone can set me straight before I nuke a bunch of my free time headed down the wrong path :)