Works perfectly fine over here:
<html>
<head>
<title>timer test</title>
<script type="text/javascript">
var SD;
var interval;
function TimeOut() {
if (!interval && !SD) {
interval = setInterval(function() { window.location("TimeUp.aspx") }, 1200000);
countDown();
}
}
var sec = 0;
var min = 02;
function countDown() {
sec--;
if (sec == -01) {
sec = 59;
min = min - 1;
}
else {
min = min;
}
if (sec <= 9) { sec = "0" + sec; }
time = (min <= 9 ? "0" + min : min) + " min and " + sec + " sec ";
if (document.getElementById) { document.getElementById('theTime').innerHTML = time; }
SD = window.setTimeout("countDown();", 1000);
if (min == '00' && sec == '00') { sec = "00"; window.clearTimeout(SD); }
}
window.onload = countDown;
function StopInterval() {
window.clearInterval(interval);
window.clearTimeout(SD);
interval = null;
SD = null;
document.getElementById('theTime').innerHTML = "";
TimeOut();
}
</script>
</head>
<body onload="TimeOut()">
<form id="form1" runat="server"></pre>
<table width="100%">
<tr>
<td width="100%" align="center">
<span id="theTime" class="timeClass"></span>
</td>
</tr>
</table></pre>
<input type="button" ID="btnNext" Value="Next" onclick="StopInterval()"/>
</body>
</html>
Could you show us what the Serverside Code does? Did you try to remove the Onclick and Runat Attribute?