<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Timer ID="Timer1" Interval="1000" OnTick="ontick" runat="server">
</asp:Timer>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="Timer1" EventName="Tick" />
</Triggers>
</asp:UpdatePanel>
<asp:Button runat="server" EnableViewState="true" Text="button" ID="btnText" />
</div>
protected void ontick(object sender, EventArgs e)
{
Thread.Sleep(2000);
TextBox1.Text = "1";
Timer1.Enabled = false;
btnText.Enabled = false;
}
滴答事件结束后按钮未禁用