How to use timer control in ajax?

aswinialuri-19361
Posted by aswinialuri-19361 under ASP.NET category on | Points: 40 | Views : 734
code in .aspx page:
 <asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:Label ID="Label1" runat="server" ></asp:Label>
<asp:Timer ID="Timer1" Interval="1000" runat="server" ontick="Timer1_Tick">
</asp:Timer>


cod in .aspx.cs page:

 static int counter=20;
protected void Timer1_Tick(object sender, EventArgs e)
{
counter--;
Label1.Text = counter.ToString();
}

Comments or Responses

Login to post response