Wednesday, August 29, 2012

Difference between ViewState and SessionState


S.NoViewStateSessionState
1
View state is maintained in page level only.
Session state is maintained in session level.
2
View state of one page is not visible in another page.i.e., when user requests another page previous page data will be no longer available.
Session state value is available in all pages within a user session.i.e., The data will be no longer available if user close the browser or session timeout occurs.
3
View state information stored in client only.
Session state information stored in server.
4
View state persist the values of particular page in the client (browser) when post back operation done.
Session state persist the data of particular user in the server. This data available till user close the browser or session time completes.
5
View state used to persist page-instance-specific data.
Session state used to persist the user-specific data on the server side.

1 comment: