What Is The Difference Between ViewState and SessionState

Showing Answers 1 - 4 of 4 Answers

krishna_v

  • Apr 3rd, 2006
 

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

  Was this answer useful?  Yes

debiprosad

  • 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.

  Was this answer useful?  Yes

Raghu

  • 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.

  Was this answer useful?  Yes

jawadtbz

  • Oct 3rd, 2007
 

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.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

Answer Question

Click here to Login / Register your free account


 
Send   Reset

 

Related Answered Questions

 

Related Open Questions