Learn how to a build a cloud-first strategyRegister Now

  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 592
  • Last Modified:

session state and viewstate

In an interview would you say, is the difference between a session state and viewstate?
1 Solution
here are a few differences

1)Unlike Session state ViewState is a property of the web controls.
2)Values stored in the session are available across different pages in an application.
Where as the data contained in a control is persisted between page's post back by using that controls ViewState property.
3)View state cannot be used if the page donot post back to itself and nformation is stored in client only.
4)Moreover Viewstate are not secured as data is exposed to client. although  we  can configure page directive and machine key to make view state encrypted. Where in case of session this is user specific data that is stored in server memory . Session state is valid for any type of objects.

Featured Post

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now