我在一页中有两个计时器,但第二个计时器不起作用。
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="Timer1_Tick">
</asp:Timer>
<asp:Timer ID="Timer2" runat="server" Interval="5000" OnTick="Timer2_Tick">
</asp:Timer>
后面的代码:
protected void Timer1_Tick(object sender, EventArgs e)
{
lblcurrenttime5.Text = DateTime.Now.ToLongTimeString();
}
protected void Timer2_Tick(object sender, EventArgs e)
{
label6.Text = "Timer 2 is working";
}