ViewState persist the values of controls of particular page in the client (browser) when post back operation done. When user requests another page previous page data no longer available.
SessionState persist the data of particular user in the server. This data available till user close the browser or session time completes.
Phani Krishna Reddy V
Login to rate this answer.
debiprosad
Answered On : Jun 30th, 2006
View State are valid mainly during postbacks and information is stored in client only. Viewstate are valid for serializable data only. 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. We can take help of session through different web pages also.
Login to rate this answer.
Raghu
Answered On : Jul 14th, 2006
Unlike Session state ViewState is a property of the web controls.
Both are used to persist certain data.
Values stored in the session are available across different pages in an application.
Where as the vdata contained in a control is persisted between page's post back by using that controls ViewState property.
View state cannot be used if the page donot post back to itself.
Login to rate this answer.
Viewstate is maintained at page level. view state of one page is not visible to another page.
session state on the other hand is maintained at the session level, it accessible to all pages within a user session.
Login to rate this answer.