Add text to web page from code-behind
<p>I am generating some text in the code-behind of web page on button click event. Earlier, in one of my desktop application, I was doing something like this.</p>

<p>For e.g.:</p>

<pre><code>public void button_click(object sender, EventArgs e)
{
      for(i=0;i&lt;=2;i++)
      {
         Label txtLabel1 = new Label(Text=i.ToString(), Color=Blue}; //Generating a label
         StackPanel1.Children.Add(txtLabel1); //Adding a label to stack panel on the desktop app
      }
      for(j=0;j&lt;=3;j++)
      {
         Label txtLabel2 = new Label(Text=j.ToString(), Color=Red}; //Generating a label
         StackPanel2.Children.Add(txtLabel1); //Adding a label to stack panel on the desktop app
      }
}
</code></pre>

<p>I do not have much experience with web development and so I am a little confused on how to do the similar thing in my ASP.NET website. In my .aspx.cs code, I can generate the strings but from the code-behind, how do I add them to the page along with their color properties as well. Thanks in advance!</p>
