读书人

使用Timer控制两个UpdatePanel中的一个

发布时间: 2012-03-30 17:32:10 作者: rapoo

使用Timer控制两个UpdatePanel中的一个
使用Timer控制两个UpdatePanel中的我有2个UpdatePanel 有1个Timer
用Timer执行定时刷新个UpdatePanel1
但是 Timer却影响了我的两个UpdatePanel2
当把放在UpdatePanel2里面的控件拖动到UpdatePanel2外部,则没有影响!
有什么办法使用Timer控制两个UpdatePanel中的一个
或者一个Timer只是控制一个UpdatePanel中的一个控件(Timer只是给一个Button计时,其他的不影响)
请叫各位回答!

先谢谢了一个

[解决办法]
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

</div>
<asp:Timer ID="Timer1" runat="server" Interval="5000" OnTick="Timer1_Tick">
</asp:Timer>
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" />
</Triggers>

</asp:UpdatePanel>
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>

UpdateMode="Conditional">这里要设置 ,,还有 <asp:AsyncPostBackTrigger ControlID="Timer1" />
这样就没问题了 !!!

读书人网 >asp.net

热点推荐