title: Asp.NET timer control is not working
body: <p>I am programming a website using  Asp.NET. I added a timer control;</p>
  
  <pre><code>&lt;asp:ScriptManager ID="ScriptManager1" runat="server"&gt;&lt;/asp:ScriptManager&gt;
          &lt;asp:Timer ID="timer" runat="server" Interval="1000" OnTick="timer_Tick" Enabled="False"&gt;&lt;/asp:Timer&gt;
          &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
              &lt;ContentTemplate&gt;
                  &lt;asp:ListBox ID="listRecords" runat="server" Style="position: absolute; top: 13px; left: 289px; height: 248px; width: 250px; background: rgba(255, 255, 255, 0.72)" Font-Names="Arial" Font-Size="X-Large" AutoPostBack="True"&gt;&lt;/asp:ListBox&gt;
              &lt;/ContentTemplate&gt;
              &lt;Triggers&gt;
  
                  &lt;asp:AsyncPostBackTrigger ControlID="timer" EventName="Tick" /&gt;
  
              &lt;/Triggers&gt;
          &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>DataSource of <code>listRecords</code> is a list named records. Timer's code behind</p>
  
  <pre><code>protected void timer_Tick(object sender, EventArgs e)
      {
          for(int a=0;a&lt;Records.Count;a++)
          {
              var item = Records[a];
              int seconds = int.Parse(item.Substring(item.Length - 2));
              int minutes = int.Parse(item.Substring(item.Length - 4, 1));
              string time = null;
              if (seconds != 0)
              {
                  seconds--;
                  time = minutes.ToString() + ":" + seconds.ToString();
              }
              if (seconds == 0)
              {
                  seconds = 59;
                  minutes--;
                  time = minutes.ToString() + ":" + seconds.ToString();
              }
              string itemPlate = item.Substring(0, item.Length - 5);
              string itemString = itemPlate + time;
              Records[a] = itemString;
          }
          listRecords.DataBind();
      }
  </code></pre>
  
  <p>Everything is fine, but even the timer is enabled;</p>
  
  <pre><code>protected void btnSubmit_Click(object sender, EventArgs e)
      {
          ...
          timer.Enabled = true;
      }
  </code></pre>
  
  <p>it's not working. First I thought it was about the code. But I set a breakpoint and saw timer_tick method never runs</p>