title: Dynamically adding divs and images during runtime - vb
body: <p>I have a table full of users which includes a username and an image. What I'm trying to do is for every user in the table, I want to create a new div with a class of "user" which contains a label for their username and their image. Here's what I have so far:</p>
  
  <pre><code>Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
      Dim label1 As New Label
      label1.ID = "label1"
      label1.Text = "Username goes here"
      Controls.Add(label1)
  End Sub
  </code></pre>
  
  <p>I found out how to add a label but I'm not sure how I'd position it, or add HTML elements with a label and image object inside them. Here's what I'm hoping the result will look like:</p>
  
  <pre><code>&lt;div class="user"&gt;
          &lt;h2&gt; Username &lt;/h2&gt;
          &lt;img src="user.png"&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p>Hopefully this could then be repeated as many times as necessary for each user.</p>