2011年2月14日星期一

UpdatePanel的精髓

UpdatePanel,最近才算是明白该怎么用,我觉得算是明白其根本,暂且叫成精髓吧。
其实就是一句话:  外层变全部,里层变部分。想让变全部,就不要把trigger放到里头去。

例如
 年龄变更的时候,父子都得变,而给儿子改名字,就没必要通知爸爸年龄变了。
<updatepanl id ="father" updatemode="congdition" runat="server">
<ContentTemplate>
   <input type="button"  Text="ReAge">Father age:30

<updatepanl id ="son" updatemode="congdition" runat="server">
<ContentTemplate>
   <input type="buttonSon" Text="ReName">Son name: abc, age:1
<ContentTemplate>
</updatepanl>

<ContentTemplate>
</updatepanl>

没有评论: