title: Adding ListItems to a DropDownList from a generic list
body: <p>I have a this aspx-code: (sample)</p>
  
  <pre><code>&lt;asp:DropDownList runat="server" ID="ddList1"&gt;&lt;/asp:DropDownList&gt;   
  </code></pre>
  
  <p>With this codebehind:</p>
  
  <pre><code>List&lt;System.Web.UI.WebControls.ListItem&gt; colors = new List&lt;System.Web.UI.WebControls.ListItem&gt;();
  colors.Add(new ListItem("Select Value", "0"));
  colors.Add(new ListItem("Red", "1"));
  colors.Add(new ListItem("Green", "2"));
  colors.Add(new ListItem("Blue", "3"));
  ddList1.DataSource = colors;
  ddList1.DataBind();
  </code></pre>
  
  <p>The output looks like this:</p>
  
  <pre><code>&lt;select name="ddList1" id="ddList1"&gt;
      &lt;option value="Select Value"&gt;Select Value&lt;/option&gt;
      &lt;option value="Red"&gt;Red&lt;/option&gt;
      &lt;option value="Green"&gt;Green&lt;/option&gt;
      &lt;option value="Blue"&gt;Blue&lt;/option&gt;
  &lt;/select&gt;   
  </code></pre>
  
  <p>My question is: Why did my values (numbers) disappear and the text used as the value AND the text? I know that it works if I use the <code>ddList1.Items.Add(New ListItem("text", "value"))</code> method, but I need to use a generic list as the datasource for other reasons.</p>