Introduction: Use timer control in ajax.
Step:1 Open visual studio and go to file
menu.
- Select website option .
- Now we select asp.net website.
- Default.aspx page open.


Step:2 Go to solution explorer and right
click.
- Select a add new item option.
- Now we select a web forms and click in add.


Step:3 Now we add ajax control.
- Go to toolbox and click ajax extensions and select timer.updatepanel,scriptmanager ,updateprogress control.
- Now we go to source and write a code.

Code:4
<%@ Page Language="VB" AutoEventWireup="false" CodeFile="sachin.aspx.vb" Inherits="sachin" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>
Timer control in ajax</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
</div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ID ="Timer1" EventName="Tick">
</asp:AsyncPostBackTrigger>
</Triggers>
<ContentTemplate>
<table border = "1">
<tr>
<td><asp:Label ID = "Label1" runat = "server" Text = "java"></asp:Label></td>
<td align = right><asp:Label ID = "lblc" runat = "server" Text = "100"></asp:Label></td>
<tr
<td><asp:Label ID = "Label2" runat = "server" Text = ".NET"></asp:Label></td>
<td align =right><asp:Label ID = "lbld" runat = "server" Text = "123"></asp:Label></td>
<tr>
<td><asp:Label ID ="Lable3" runat = "server" Text = "php"></asp:Label></td>
<td align =right><asp:Label ID = "lble" runat = "server" Text = "124"></asp:Label></td>
</tr>
</tr>
</tr>
</table>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>updating....</ProgressTemplate>
</asp:UpdateProgress>
<asp:Timer ID="Timer1" runat="server" Interval = "20" OnTick = "Timer1_Tick">
</asp:Timer>
</form>
</body>
</html>
Step:4 Now double click in timercontrol and
write a code.
Code:
Protected Sub Timer1_Tick(sender
As Object, e As
System.EventArgs)
Handles Timer1.Tick
Threading.Thread.Sleep(500)
lblc.Text =
((Int32.Parse(lblc.Text)) + 1).ToString()
lbld.Text =
((Int32.Parse(lbld.Text)) + 1).ToString()
lble.Text =
((Int32.Parse(lble.Text)) + 1).ToString()
End Sub
