Is it possible to do data caching in client-side in asp.net using c#?
I am planning to cache a
The only real option you have to store large amounts of data client side is by using the
ViewState. It will only exist on the page you add it to though. So if you are jumping around from page to page it won't really work. In that case you really should be using
Application Cache depending on your scenario.
So if you are doing something where you are always on the same page and just doing many
PostBacks for things like paging or sorting then
ViewState will work fine but do realize you will be passing large amounts of data back and forth to the server each time a
PostBack is made.
// Set it ViewState["YourData"] = yourDataSet; // Get it DataSet ds = ViewState["YourData"] as DataSet;
Session and the
Application Cache are accessed the same way. Just replace
ViewState with the word
More information regarding the 3 methods can be found on MSDN:
You might want to check out the following links as well: