caching - How to cache a List of objects in ASP.NET -


I have a list of items in an asp.net page when I load the page in the browser for the first time, I get the data from, create objects with those data and populate the list. All these page load events are done inside the handler. Now when the page is posted back to the page, the previous list has expired, because the variables have all been freed.

How can I cache this list so that when all this stuff is available when this page is posted back?

Elon asked, is this data user-specific or is this site unique?

If the data is user-specific, you can use the session state to store it, though it will expire when the user session will end, and in some cases still on your database server A roundtrip (if for example SQL server is changed instead of in-PCS, etc.).

If the data is detailed, you can also use it. This site is comprehensive, the process remains in the domain and is therefore available to everyone on that server, especially when using it in a multi-server scenario, but it is easily possible.

It should be noted that the application cache (and any other global setup) can slow down your app, first user to hit the site if setup takes time. IIS 7 and ASP.Net have tried to resolve this with the recently released modules so that it can be ensured that the global cash is either pre-populated, or survives.


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -