Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

Which is better as performance Viewstate or Session for storing data

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.


This post first appeared on Asp.netSourceCodes, please read the originial post: here

Share the post

Which is better as performance Viewstate or Session for storing data

×

Subscribe to Asp.netsourcecodes

Get updates delivered right to your inbox!

Thank you for your subscription

×