Understand ASP.NET ViewState

來源:互聯網
上載者:User
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專門指普通的,用來向伺服器端提交資料的表單)的值的.
比如Input 裡面的TextBox,Submit, CheckBox, Select等等。這些control由於實施了IPostBackDataHandler介面,所以他們的value並沒有儲存在ViewState裡面。

但是他們的其他屬性比如background color等如果有的話是要儲存在ViewState裡面的。

ViewState是用來恢複和儲存那些
被設定為runat=”server”的,
沒有實施了IPostBackDataHandler介面的,
control的屬性.是屬性,不僅僅是值.

相關文章

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.