Introduction

Suppose you need to update your web page on client computer’s screen every one minutes without your client direct intention, then you may use the advantage of AJAX timer object. if this is the case you may found this walkthrough useful.

Using the right code

First of all you need to place a ScriptManager from AJAX extensions to the page:

<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>

Then you add a Timer control to the page right after the ScriptManager:

<asp:timer runat="server" ID="timer1"  Enabled="true"  Interval="1000" ></asp:timer>

Please note:
Interval: specifies time interval between server side script in millisecond.

You may then add a script to handle time tick, here i used this script to show the client, server current time and date. you may modify it for your own use:

Sub timer() Handles timer1.Tick
    Response.Write(Date.Now)
End Sub
© 2012 Amin Mahpour Suffusion theme by Sayontan Sinha