zhou JamesID:jameszhou
84153次访问,排名1054好友0人,关注者25
PMP & MCAD
jameszhou的文章
原创 85 篇
翻译 0 篇
转载 0 篇
评论 73 篇
James Zhou的公告
Locations of visitors to this page

最近评论
xkpkhu:wow power leveling
控制帐户:很好。
找了半天什么是控制帐户,终于看到这里有说明。
不过英文看起来恼火。
dd:这里面好多不根本不明白Silverlight 是做什么的,或者说是应用在什么方面的.随便乱说.
出会い系サイト:出会い出会い系サイト出会い喫茶出会い掲示板ナンパ出会いカ……
aladdin:這沒有帶來什麼思想解放阿...

1. HttpContext.RewriteUrl,從2003年就開始用了。

2. M$沒事把這些並不是常常需要用到的把戲,弄得好像和藹可親,但卻常常忘記了: 1) Layering,2) Lightweight,再加上M$常常給出不正確的practice,以致於新的小朋友進公司,還得要花上很多時間把這些錯誤從他們的……
文章分类
收藏
    相册
    链接
    Old Blog - Runner on .NET
    存档
    订阅我的博客
    XML聚合  FeedSky

    原创 ASP.NET 2.0 - Control State收藏

    新一篇: ADO.NET 2.0 - New things | 旧一篇: ASP.NET 3.5 Extension (CTP) - Dynamic Data的元数据

    Control State
    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. Behavioral aspects of controls like pagination in the DataGrid or selection change notifications in textboxes require view state to be enabled to function properly. I'm sure all of you are sufficiently daunted by the prospect of leaving view state enabled in any of your DataGrids at this point. In ASP.NET 2.0, Microsoft addresses this particular problem by partitioning the view state into two separate and distinct categories: view state and control state.
    Control state is another type of hidden state reserved exclusively for controls to maintain their core behavioral functionality, whereas view state only contains state to maintain the control's contents (UI). Technically, control state is stored in the same hidden field as view state (being just another leaf node at the end of the view state hierarchy), but if you disable view state on a particular control, or on an entire page, the control state is still propagated. The nice aspect of this implementation is that we can now amend our original principle on optimizing view state for ASP.NET 2.0 to be much stronger: if you populate the contents of a control every time a page is requested, you should disable view state for that control.
    As long as control builders properly partition their state into behavioral state (to maintain core functionality) and UI state (to retain contents), this statement should be followed religiously. I would like to tell you to start following this recommendation now with all work done in ASP.NET 2.0, but the DataGrid has not been refactored to keep its behavioral state in control state. Fortunately, the new GridView is the logical successor to the DataGrid and it uses control state properly, as do the new versions of the TextBox and DropDownList controls.

    Declarative Data Sources and View State
    There is a small problem with the application of our view state optimization principle—you will very often not know whether you are populating the contents of a control on each request or not. The introduction of declarative data sources in ASP.NET 2.0 means that binding data to a control no longer involves explicitly wiring up its Data source property to a DataReader or DataSet and calling DataBind. Instead, you can declaratively place a data source on your page and point your control to that data source, for example using the new GridView class and an associated SqlDataSource bound to the authors table in the pubs database (see Figure 8). If you run this page, you will find that it just works. The GridView and its corresponding data source are smart enough to know when to interact. By the time the page is ready to render, the GridView is full of data from the data source and will properly render the entire authors table to the client.

    http://msdn2.microsoft.com/en-us/magazine/cc163901.aspx

    发表于 @ 2008年03月09日 16:53:00|评论(loading...)|编辑

    新一篇: ADO.NET 2.0 - New things | 旧一篇: ASP.NET 3.5 Extension (CTP) - Dynamic Data的元数据

    评论

    #downmoon 发表于2008-03-10 08:23:41  IP: 122.224.123.*
    请问楼主是PMP还是IPMP?
    发表评论  


    登录
    Csdn Blog version 3.1a
    Copyright © James Zhou