title: showing the loop value in label runtime ASP..NET
body: <p>Iam newbie to ASP.NET, and this is my first question on this forum.
  Here is my code:</p>
  
  <pre><code>protected void Button1_Click(object sender, EventArgs e)
          {
              for (int i = 0; i &lt; 10; i++) 
              {
                  Label2.Text = i.ToString();
                  UpdatePanel1.Update();
                  Thread.Sleep(3000);
              }
          }
  
  
  &lt;asp:UpdatePanel ID="UpdatePanel1" runat="server"&gt;
          &lt;ContentTemplate&gt;
              &lt;asp:Label ID="Label1" runat="server" Text=""&gt;&lt;/asp:Label&gt;
              &lt;asp:Button ID="Button1" runat="server" Text="Button" onclick="Button1_Click"/&gt;
              &lt;asp:Label ID="Label2" runat="server" Text=""&gt;&lt;/asp:Label&gt;
          &lt;/ContentTemplate&gt;
  &lt;/asp:UpdatePanel&gt;
  </code></pre>
  
  <p>I want to display the value of i each time when its get updated, but I got the value 9.
  Please help me how can achieve my goal... No luck so far</p>