Some Articles Help You To Understand ASP.NET ViewState

A list of good articles to help understand ASP.NET ViewState

ViewState: All You Wanted to Know

ViewState and JavaBean The ASP.NET Alternative part give us a overview of how ViewStae works

Taking a Bite Out of ASP.NET ViewState is another MSDN article

Understanding ASP.NET View State by Scott Mitchell from 4GuysFromRolla.com is the lastes MSDN article about ViewState

以下是个人的一些理解:

ASP.NET的一大好处就是很多html control 都可以设定为runat=“server“,变成可以在服务器端控制的control.
这也是导致误解ViewState的一个原因。

ViewState不是用来恢复Form(此处Form专门指普通的,用来向服务器端提交数据的表单)的值(value)的.
比如Input 里面的TextBox,Submit, CheckBox, Select等等,这些control由于实施了IPostBackDataHandler接口,所以他们的value并没有保存在ViewState里面,因此也不用ViewState来恢复.

但是他们的其他属性比如background color等,如果有的话是要保存在ViewState里面的.

ViewState是用来恢复和保存那些
被设定为runat=”server”的,
没有实施了IPostBackDataHandler接口的,
control的属性.是属性,不仅仅是值.
比如Label, Calendar等等和其他微软自己引入的control.

posted on 2004-06-18 17:22  番茄鸡蛋面  阅读(1049)  评论(1编辑  收藏  举报

导航