我有这个代码:
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Timer ID="Timer1" runat="server" Interval="1000" OnTick="TickEvent"></asp:Timer>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<img src="http://jimpunk.net/Loading/wp-content/uploads/loading18.gif" />
</ProgressTemplate>
</asp:UpdateProgress>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
</div>
</form>
代码隐藏代码:
protected void TickEvent(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();
}
但是当我运行页面时,时间不会更新,进度面板也不会显示。任何人都可以帮忙吗?