title: ASP.Net page load updating Update Panel
body: <p>I'm new to AJAX and wondered if i'm approaching things in the right way.</p>
  
  <p>The page i'm building is literally just a progress page. i.e a process gets invoked from the page load and I add a message to the page to show the result, then another process runs and I add a new message for the result of that process etc, up to 10 processes can run sequentially and there is no user interaction. I didn't want the screen to flicker after each update message so I thought of Ajax</p>
  
  <p>The way i've achieved this seems odd.....</p>
  
  <ul>
  <li>Setup <code>UpdatePanel</code> with a hidden button in it</li>
  <li>Create a <code>ClientScriptManager</code> on Code Behind Page Load to invoke a Javascript function (1st time in)</li>
  <li>'Click' the button in the Javascript function</li>
  <li>Do the 1st Process on the C# code behind in the <code>Button_Click</code> method</li>
  <li>Use the <code>ClientScriptManager</code> in the c# to <code>Invoke</code> the Javascript to click the button again</li>
  <li>Do the next Process on the C# code behind in the <code>Button_Click</code> method</li>
  </ul>
  
  <p>I'd rather just start the processes on the C# page load and update the <code>UpdatePanel</code> without it flashing.!</p>
  
  <p>*<em>*</em>*Here is my latest code using your recommendations with the Sleep Thread emulating the processes which will be taking place, however it's not updating in real time....i.e Recalculating Quotation and Storing Data appear after both instructions have completed. </p>
  
  <pre><code>            Literal literal1 = new Literal();
              literal1.Text = "Recalculating Quotation &lt;br/&gt;";
              literal1.ID = "Message1";
              updpnlSubmit.ContentTemplateContainer.Controls.Add(literal1);
              updpnlSubmit.Update();
  
              Thread.Sleep(10000);
  
              Literal literal2 = new Literal();
              literal2.Text = "Storing Data&lt;br/&gt;";
              literal2.ID = "Message2";
              updpnlSubmit.ContentTemplateContainer.Controls.Add(literal2);
              updpnlSubmit.Update();
  </code></pre>