title: Single fire of Timers tick event in an UpdatePanel
body: <p>I going through some code that I inherited. The page has an update panel and in it there is a timer control. </p>
  
  <pre><code> &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
    &lt;asp:Timer ID="process" runat="server" Interval="1500" OnTick="process_Tick"&gt;
    &lt;/asp:Timer&gt;
   &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>In code behind in the beginning of  tick event of timer:</p>
  
  <pre><code>  protected void process_Tick(object sender, EventArgs e)
      {
          process.Enabled = false;
  </code></pre>
  
  <p>the timer is disabled..most probably so that the tick is fired only once. Later in the event we have atleast two places where thread is put to sleep to intoduce some waiting in the processing:</p>
  
  <pre><code>Thread.Sleep(18000);
  </code></pre>
  
  <p>and also </p>
  
  <pre><code>Thread.Sleep(10 * 1000);
  </code></pre>
  
  <p>These two threads stops processing for a while but cause postbacks on different threads and tick event is fired on each thread....</p>
  
  <p>How to stop these threads being created and firing the tick event again and again. Because of this code, a form is submitted couple of times.</p>
  
  <p>Any help will be much appreciated.</p>