title: Can I populate list items in a ASP.NET dropdown list from a ASP.NET Placeholder?
body: <p>I'm designing my own custom control that contains a .NET dropdownlist. What I'm wondering is if it is possible to populate my dropdownlist with listitems placed in a placeholder?</p>
  
  <p>For example:</p>
  
  <pre><code>&lt;asp:DropDownList ID="ddlFilter" runat="server" &gt;
    &lt;asp:PlaceHolder ID="ListItemPlaceholder" runat="server"/&gt;
  &lt;/asp:DropDownList&gt;
  </code></pre>
  
  <p>This doesn't work because the DropDownList control only allows ListItems as child controls. But, I want to do something similar to this so when the user includes my control on a page, they can do something like this:</p>
  
  <pre><code>&lt;mytag:MyControl Mode="DropDown" runat="server"&gt;
      &lt;ListItemTemplate&gt;
          &lt;asp:ListItem Text="C" Value="c"&gt;&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Text="E" Value="e"&gt;&lt;/asp:ListItem&gt;
          &lt;asp:ListItem Text="B" Value="b"&gt;&lt;/asp:ListItem&gt;
      &lt;/ListItemTemplate&gt;
  &lt;/myTag:MyControl&gt;
  </code></pre>
  
  <p>Any suggestions or ideas? I know I can do this by dynamically adding the ListItems in the page code behind, but I'd like to avoid that if possible. Thanks!</p>