Usage of Timer control..

Bharathi Cherukuri
Posted by Bharathi Cherukuri under ASP.NET AJAX category on | Points: 40 | Views : 1204
Below is an example showing the working of a Timer control. It updates a timestamp every 5 seconds.


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "">
<html xmlns="">
<head runat="server">
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<asp:Timer runat="server" id="UpdateTimer" interval="5000" ontick="UpdateTimer_Tick" />
<asp:UpdatePanel runat="server" id="TimedPanel" updatemode="Conditional">
<asp:AsyncPostBackTrigger controlid="UpdateTimer" eventname="Tick" />
<asp:Label runat="server" id="DateStampLabel" />

Comments or Responses

Login to post response