关键是将updatepanel的 UpdateMode 设置为 UpdateMode ="Conditional" 默认的话是always 所以同一个页面中的不同updatepanel 总不同时更新,觉的十分不爽,我们设置为 UpdateMode ="Conditional" ,即条件更新后,情况就不同了。






接下来我们再在我们想要触发更新的updatepanel 中加入
<Triggers ><asp:AsyncPostBackTrigger ControlID ="Button2" EventName ="Click" /></Triggers>
这样的话呢,点击button时的updatepanel2才更新呦。好的问题解决了,和大家共享吧。
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode ="Conditional">
<ContentTemplate>
2---<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
<Triggers ><asp:AsyncPostBackTrigger ControlID ="Button2" EventName ="Click" /></Triggers>
</asp:UpdatePanel>
<ContentTemplate>
2---<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
<Triggers ><asp:AsyncPostBackTrigger ControlID ="Button2" EventName ="Click" /></Triggers>
</asp:UpdatePanel>






