You can use ajax for it.
Example Javascript:
var _count = 0;
var _max = 200;
var secs;
var timerID = null;
var timerRunning = false;
var delay = 5000;
var J = jQuery.noConflict();
function InitializeTimer() {
secs = 10000;
StopTheClock();
StartTheTimer();
}
function StopTheClock() {
if (timerRunning)
clearTimeout(timerID);
timerRunning = false;
}
function StartTheTimer() {
var id = _count;
J.ajax({
url: "GetNextLink.ashx",
type: "GET",
dataType: 'html',
data: { 'Next': id },
success: function (data) {
J('#divLinks').html(J('#divLinks').html()+data);
}
});
_count++;
if (secs == 0) {
StopTheClock();
}
else {
if (_max == _count) {
StopTheClock();
}
else {
self.status = secs;
secs = secs – 1;
timerRunning = true;
timerID = self.setTimeout("StartTheTimer()", delay);
}
}
}
C# code
Page.ClientScript.RegisterStartupScript(this.GetType(), "javaScript", "InitializeTimer();", true);