Difference between View State and Session State

Session state and view state are used to keep on certain data.

View State:

- View state is maintained in page level only.
- View state of one page is not visible in another page.
- View state information stored in client only.
- View state persist the values of particular page in the client (browser) when post back operation done.
- View state used to persist page-instance-specific data.

Session State:
- Session state is maintained in session level.
- Session state value is available in all pages within a user session.
- Session state information stored in server.
- Session state persist the data of particular user in the server. This data available till user close the browser or session time completes.
- Session state used to persist the user-specific data on the server side.

...S.VinothkumaR.

7 comments:

Dhinesh Paramasivam said...
This comment has been removed by the author.
Dhinesh Paramasivam said...

Nice and very useful

Dhinesh Paramasivam said...

Nice and very useful

Vijeya Shobana said...

yep, useful tips thaan. thk u vinoth

Ray Lopez said...

"View state persist the values of particular page in the client (browser) when post back operation done." - for this reason I find Session State is more reliable for program flow... I can never quite be sure what values are being in ViewState it seems, but the same is not true for session state.

Dhavapriya said...

Nice.. easy to understand... thank u

Dhavapriya said...

nice.. easy to understand.. thank u