What Is The Difference Between ViewState and SessionState?

Answer Posted / pooooo

Session State contains information that is pertaining to a specific session (by a particular client/browser/machine) with the server. It's a way to track what the user is doing on the site.. across multiple pages...amid the statelessness of the Web. e.g. the contents of a particular user's shopping cart is session data. Cookies can be used for session state.
View State on the other hand is information specific to particular web page. It is stored in a hidden field so that it isn't visible to the user. It is used to maintain the user's illusion that the page remembers what he did on it the last time - dont give him a clean page every time he posts back.

Is This Answer Correct ?    8 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is lock in c#?

486


What is the difference between virtual method and abstract method?

546


Explain code compilation in c#.

527


Define an escape sequence, name few strings in escape sequence?

479


What are the types of operator?

458






What is object type in c#?

551


What is argument in c#?

520


What are the three types of predicates?

461


Why is lazy loading?

497


What does the initial catalog parameter define in the connection string?

485


In .NET how can you solve the DLL Hell problem?

672


What are satellite assemblies? How will you get the different language strings?

486


Are structs faster than classes?

539


Where do we use static class in c#?

496


What is the difference between proc. Sent by val and by sub?

483