Click here to Skip to main content
15,916,042 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I need to know the difference between cookie and view state
Posted

 
Share this answer
 
Comments
Uday P.Singh 20-Sep-11 9:46am    
good link 5!
The first result from a Google search[^] is this[^].
 
Share this answer
 
Hi
the two concepts are maintaining for state of user.those comes under State Management Concepts.

cookies are stored in client system and controlled by server side.
View State are stored and controlled by server side.

cookies are not safe while to store sensitive information.
Viewstate are used for passing data between pages like querystring
and another thing is control level view state is ther.If you don't want to post control data to server when user clicks on form postback button then you can set viewstate of that control is false.

View state are used hidden fields to store control information.

you can see this in real time in web page open view source then you'll see clearly the viewstate information is stored in input hidden control.

This is about Viewstate and cookie.

And here 'm providing some links for better understanding about SMC

http://forums.asp.net/t/983980.aspx/1?Usage+scenarios+for+view+state+session+state+application+state+cookies
And
http://sanelite.wordpress.com/2011/01/12/difference-between-application-session-view-state-cookies-query-string/

I hope I clear your doubt.If not Sorry

All the Best
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900