Which is better as performance Viewstate or Session for storing data
Which is better as Performance Viewstate or Session for storing some kind of ID.
Answer :
- Viewstate and session both are different scenario Viewstate used for storing kind of data for current page/context while session storing kind of data for whole application context so totally depends on requirements but straightforward Viewstate is faster compare with other but remember it's work only current page.
- For large amounts of data, Sessionis way more efficient. If you can detect when the user is done with a particular block of data, set the Session variable to null, to help memory overhead. You can't always do this, but theSession will eventually expire and the memory will be reclaimed then.
- In this scenario session give better performance, Session is much better when large data is to be processed.
Users Please post your answer too.