How to populate a DropDownList using a List<ListItem>
<p>I have a DropDownList.</p>

<p>I need populate it with item collected in a <code>List&lt;ListItem&gt;</code>.</p>

<p>In my script, collector has been populated properly.</p>

<p>But I cannot populate the DropDownList. I receive an error:</p>

<pre><code>DataBinding: 'System.Web.UI.WebControls.ListItem' does not contain a property with the name 'UserName'."}
</code></pre>

<hr>

<pre><code>&lt;asp:DropDownList ID="uxListUsers" runat="server" DataTextField="UserName" 
DataValueField="UserId"&gt;
</code></pre>

<hr>

<pre><code>            List&lt;ListItem&gt; myListUsersInRoles = new List&lt;ListItem&gt;();
            foreach (aspnet_Users myUser in context.aspnet_Users)
            {
                // Use of navigation Property EntitySet
                if (myUser.aspnet_Roles.Any(r =&gt; r.RoleName == "CMS-AUTHOR" || r.RoleName == "CMS-EDITOR"))
                    myListUsersInRoles.Add(new ListItem(myUser.UserName.ToString(), myUser.UserId.ToString()));
            }
            uxListUsers.DataSource = myListUsersInRoles; // MAYBE PROBLEM HERE????
            uxListUsers.DataBind();
</code></pre>

<p>Any ideas? Thanks</p>
