我先前提过,ASP.NET 1 . x中使用服务器端控件最另人沮丧的一面是关于ViewState的非全有即全无的状态。
I mentioned earlier that one of the most frustrating aspects of working with server-side controls in ASP.NET 1.x is the all-or-nothing mentality with respect to view state.
这很重要,因为 ASP.NET 中的大部分服务器端控件模型是根据这样一个假设生成的,那就是 — 如果用户回发到相同页面,所有控件保持其状态不变。
This is important because much of the server-side control model in ASP.NET is built around the assumption that all controls retain their state if the user posts back to the same page.
若要在服务器端使用用户输入的值,则获取并设置绑定到控件的数据元素。
To work with user-entered values on the server side, you get and set the data elements bound to the controls.
应用推荐