How to set datasource of listbox from generic list of class
<p>How can I bind List to the datasource of a Listbox? I want to to set the visible property Name.</p>

<p>Here is my class and list:</p>

<pre><code> public class Users
 {
    public string Name { get; set; }
    public DateTime Data { get; set; }
    public int Id { get; set; }
    public Users()
    {
        Name = null;
        Data = DateTime.Now;
        Id = 0;
    }
    public Users(string N,DateTime dateTime, int id)
    {
        Name = N;
        Data = dateTime;
        Id = id;
    }
}
</code></pre>

<p>Here is how I try to bound the datasource:</p>

<pre><code>        ListBox1.DataSource = ((List&lt;Users&gt;) Application["Users_On"]);
        ListBox1.DataBind();
</code></pre>
