是什么SessionState会和ViewState的区别? [英] What is the difference between SessionState and ViewState?

查看:168
本文介绍了是什么SessionState会和ViewState的区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是什么在ASP.NET SessionState会和ViewState的区别?

What is the difference between SessionState and ViewState in ASP.NET?

推荐答案

(由一个特定的客户端/浏览器/机)的会话状态包含一个与特定的会话信息。它来跟踪用户在做网站上的方式.. 在多个网页 ...际网络的无国籍。例如特定用户的购物车中的内容是会话数据。 Cookie可以用于会话状态。

查看状态,另一方面是针对特定的网页信息。它存储在一个隐藏字段,以便它是对用户不可见的。它是用来维护用户的错觉,以为网页记得他上它确实是最后一次 - 不,他每次回发时给他一个干净的页面。 选中该页面了解更多

Session State contains information that is pertaining to a specific session (by a particular client/browser/machine) with the server. It's a way to track what the user is doing on the site.. across multiple pages...amid the statelessness of the Web. e.g. the contents of a particular user's shopping cart is session data. Cookies can be used for session state.
View State on the other hand is information specific to particular web page. It is stored in a hidden field so that it isn't visible to the user. It is used to maintain the user's illusion that the page remembers what he did on it the last time - dont give him a clean page every time he posts back. Check this page for more.

这篇关于是什么SessionState会和ViewState的区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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