Cookie和视图状态之间的区别 [英] difference between cookie and view state

查看:89
本文介绍了Cookie和视图状态之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我需要了解cookie和视图状态之间的区别

I need to know the difference between cookie and view state

推荐答案

使用此链接:

第一个结果来自Google 搜索 [ ^ ]是
The first result from a Google search[^] is this[^].



这两个概念针对用户状态进行维护.这些概念属于状态管理概念.

cookie存储在客户端系统中,并由服务器端控制.
视图状态由服务器端存储和控制.

Cookies在存储敏感信息时并不安全.
Viewstate用于在页面之间传递数据,例如querystring
另一件事是控件级别的视图状态是ther.如果您不希望在用户单击表单回发按钮时将控件数据发布到服务器,则可以将该控件的viewstate设置为false.

视图状态用于隐藏字段以存储控制信息.

您可以在网页打开视图源中实时看到此信息,然后可以清楚地看到视图状态信息存储在输入隐藏控件中.

这是关于Viewstate和Cookie的.

并且这里" m提供了一些链接,以使您更好地了解SMC

http://论坛. asp.net/t/983980.aspx/1?用法+场景+ for +视图+状态+会话+状态+应用程序+状态+ cookies

还有
http://sanelite.wordpress.com /2011/01/12/difference-between-application-session-view-state-cookies-query-string/

希望我能清除您的疑问.如果不是很抱歉,

最好的
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


这篇关于Cookie和视图状态之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆