---
title: "ASP.Net AJAX Server Control: Timer"  
description: "Timer: The timer control will execute client side event s at specific interval and allows specific part so your page to update or refresh at these mom"  
author: "Amit Singh"  
published: 2010-10-05  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/150/asp-dot-net-ajax-server-control-timer  
category: "ajax"  
tags: ["ajax"]  
reading_time: 1 minute  

---

# ASP.Net AJAX Server Control: Timer

Timer: The timer control will execute client side event s at specific interval and allows specific part so your page to update or refresh at these moments.\

How we implement the Timer server control

**Step1:** we use the following control on aspx page

##### Example:

```
 <body>  <form id="form1" runat="server">  <div>     <%--Using ScriptManger Control--%>     <asp:ScriptManager ID="ScriptManager1" runat="server">     </asp:ScriptManager>     <%--Using UpdatePanel Control--%>     <asp:UpdatePanel ID="UpdatePanel1" runat="server">     <ContentTemplate>     <%-- Using Label And Timer Control inside UpdatePanel--%>     <asp:Label ID="lblDateTime" runat="server"  Text=""> </asp:Label>     <asp:Timer ID="Timer1"runat="server"Interval="9000"OnTick= "Timer1_Tick">     </asp:Timer>     </ContentTemplate>     </asp:UpdatePanel>  </div>  </form></body>
```

**Step2:** We write the following code on Timer1_Tick event.

##### Example:

```
 protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { lblDateTime.Text ="Start DateTime: "+ DateTime.Now.ToString(); } } protected void Timer1_Tick(object sender, EventArgs e) { lblDateTime.Text ="By Timer: "+ DateTime.Now.ToString();}
```

**Step3**: Run the project

##### Output:

![ASP.Net AJAX Server Control: Timer](https://www.mindstick.com/mindstickarticle/385ebacd-89e2-40d3-868a-0185e7c45f15/images/7bc59450-31c0-4923-ad9c-523906fdf403.png)

After Sometimes, the output is:

![ASP.Net AJAX Server Control: Timer](https://www.mindstick.com/mindstickarticle/385ebacd-89e2-40d3-868a-0185e7c45f15/images/85131839-5830-4e73-a9ad-5af5edccaf63.png) This is the simple example of **Timer and UpdatePanel** control, how we use these control in our web based project or window based project.

\

---

Original Source: https://www.mindstick.com/articles/150/asp-dot-net-ajax-server-control-timer

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
