J
Johan
I'm running a timer as a VBScript on a VB.NET webpage. The problem is
that
at postback the script seems to start all over again and the timer is
reset. Is there a way to prevent this?
<SCRIPT language="VBScript">
<!--
dim StartTime
dim Time
dim timerID
sub StartTimer()
if StartTime=0 then
StartTime=timer()
end if
timerID = setTimeout("UpdateTimer()", 1000)
end sub
sub UpdateTimer()
if Postback=true then
exit sub
end if
Time=timer()-StartTime
document.Form1.lblTimer.value=Cstr(Time)
timerID = setTimeout("UpdateTimer()", 1000)
end sub
-->
</SCRIPT>
that
at postback the script seems to start all over again and the timer is
reset. Is there a way to prevent this?
<SCRIPT language="VBScript">
<!--
dim StartTime
dim Time
dim timerID
sub StartTimer()
if StartTime=0 then
StartTime=timer()
end if
timerID = setTimeout("UpdateTimer()", 1000)
end sub
sub UpdateTimer()
if Postback=true then
exit sub
end if
Time=timer()-StartTime
document.Form1.lblTimer.value=Cstr(Time)
timerID = setTimeout("UpdateTimer()", 1000)
end sub
-->
</SCRIPT>