ASP.NET Javascript Timer
<p>I have a countdown timer in javascript that is called by a code behind using asp.net VB. I cannot find a way to keep track of the time ,. </p>

<p>the problem is., I cannot get the time that elapsed after postback so that the timer would continue ticking,. can you help me please,.?? I would really appreciate it.,</p>

<p>here is my code fragment: </p>

<p>asp.net VB codebehid</p>

<pre><code>    on page load{
        If Page.IsPostBack = True Then
            ClientScript.RegisterClientScriptBlock(Me.GetType, "timer_script",
           "&lt;script language='javascript'&gt;function mySubmit()&lt;/script&gt;")

            ClientScript.RegisterStartupScript(Me.GetType, "timer_script", 
            "&lt;script&gt;countdown_clock();&lt;/script&gt;")
        End If

        If Page.IsPostBack = false Then
            TimerTxtbx.Text = "00:06:10"   'hour:min:sec -&gt; initialize timer
            ClientScript.RegisterClientScriptBlock(Me.GetType, "timer_script",
           "&lt;script language='javascript'&gt;function mySubmit()&lt;/script&gt;")

            ClientScript.RegisterStartupScript(Me.GetType, "timer_script", 
            "&lt;script&gt;countdown_clock();&lt;/script&gt;")
        End If
    }

    on button click{
        NextBtn.Attributes.Add("onclick", "mySubmit()")   'call a javascript function

        ClientScript.RegisterStartupScript(Me.GetType, "timer_script", 
        "&lt;script&gt;countdown_clock();&lt;/script&gt;")
    }
</code></pre>

<p>javascript code:</p>

<pre><code>function mySubmit()
{
 document.getElementById('TimerTxtbx').removeAttribute('disabled');
}

    function countdown_clock()
{     
    var current_time;
 current_time = document.getElementById('TimerTxtbx').value;


 var hours = current_time.substring(0,2);
 var minutes = current_time.substring(3,5);
 var seconds = current_time.substring(6,8); 

 var n_seconds;
 var n_minutes = minutes;
 var n_hours = hours;

 if (seconds == 0)
 {
    n_seconds = 59;

    if (minutes == 0)
  {
  n_minutes = 59;
   if (hours == 0){
   alert('Time is up');
   return;
   }
          else{ 
          n_hours = hours - 1;
      if (n_hours &lt; 10)
             n_hours = "0" + n_hours;
          }
         }
  else
  {
   n_minutes = minutes - 1;
   if (n_minutes &lt; 10)
    n_minutes = "0" + n_minutes;
  }
 }
 else
 {
     n_seconds = seconds - 1;
  if (n_seconds &lt; 10)
   n_seconds = "0" + n_seconds;
 }


      document.getElementById('TimerTxtbx').value = n_hours + ':' + n_minutes + ':' + n_seconds;

      setTimeout("countdown_clock()",1000); //function call and delay by 1sec

      document.getElementById('TimerTxtbx').setAttribute('disabled','disabled');
      }//end function
</code></pre>
