title: How to use threads in asp.net?
body: <p>I have web forms application. On one form I have a few functions. Which are called syncronously and takes some time. So I need to call them in different threads.</p>
  
  <p>This is the sample of what I'm doing:</p>
  
  <pre><code>    protected void Page_Load(object sender, EventArgs e)
      {
          Thread t1 = new Thread(new ThreadStart(Function1));
          t1.Start();
          Thread t2 = new Thread(new ThreadStart(Function2));
          t2.Start();
      }
  
      private void Function1()
      {
          Thread.Sleep(5000);
          lbl1.Text = "Function1 completed";
      }
  
      private void Function2()
      {
          Thread.Sleep(5000);
          lbl2.Text = "Function2 completed";
      }
  </code></pre>
  
  <p>If I debug (set breackpoints) <code>lbl1.Text = "Function1 completed";</code> and <code>lbl2.Text = "Function2 completed";</code> is getting called, but there texts are not changing on final html page.</p>
  
  <p>Also Page load does not takes 5 sec.</p>
  
  <p>p.s. I know asp net works different but I have no idea what I'm doing wrong.</p>