Creating dynamic labels not holding individual text
<p>I'm trying to create multiple instances of a user control on the page. I'm using labels to assign values to each control. 
So from code behind I'm creating dynamic labels as:</p>

<pre><code>Label lblName = new Label();
lblName.ID = "lblName_" + entity.Id; // lblName_1, lblName_2, lblName_3, ...etc
lblName.Text = entity.Name;
this.Page.Controls.Add(lblName);
lblName.Style.Add(HtmlTextWriterStyle.Display, "none");
</code></pre>

<p>This is applied in the loop. But all the controls gets values of last instance of label; instead of individual.</p>
