title: Adding links to a DIV tag from c# code-behind dynamically
body: <p>I'm not sure until I make a database call how many links I will need on a page and where the links point to. Thus, I need to create 'x' number of links within a div tag on the front end. Any ideas how this can be achieved?</p>
  
  <p>Heres what I tried -</p>
  
  <pre><code>foreach (KeyValuePair&lt;string, string&gt; kvp in attachments)
  {
      HyperLink hyp = new HyperLink();
      hyp.ID = kvp.Key;
      hyp.Text = kvp.Value;
      attachmentHiddenDiv.Controls.Add(hyp);
  }
  </code></pre>