title: Dynamically adding user control to page using place holder
body: <p>I am attempting to add a user control to a place holder. I am placing the user control inside of a list item <code>&lt;li&gt;</code> userControl <code>&lt;/li&gt;</code>, then placing the list item inside of an unordered list <code>&lt;ul&gt;&lt;li&gt;</code>user control<code>&lt;/li&gt;&lt;/ul&gt;</code>, and then adding the unordered list to the place holder, phMain.Controls.Add(myUnorderedList)... Code below:</p>
  
  <pre><code>var myListItem = new HtmlGenericControl("li");
  var preview = new UserControls_ChiotsPreview();
  preview = (UserControls_ChiotsPreview)LoadControl(typeof(UserControls_ChiotsPreview), null);
  myListItem.Controls.Add(preview);
  myUnorderedList.Controls.Add(myListItem);
  placeholderMain.Controls.Add(myUnorderedList);
  </code></pre>