title: How to bind additional data to an asp.net listbox control?
body: <p>Using asp.net webforms I need to store additional data (other than the <code>value</code> field and the <code>text</code> field) in each list item.</p>
  
  <p>Here's my datasource:</p>
  
  <pre><code>class Person 
   {
        public string Name {get;set;}
        public string PersonId {get;set;}
        public string PersonType {get;set;}
   }
  
   List&lt;Person&gt; lista = GetPersons();
  
   ListBox1.DataTextField = "Name";
   ListBox1.DataValueField = "PersonId";
   ListBox1.DataSource = lista;
   ListBox1.DataBind();
  </code></pre>
  
  <p>The <code>DataTextField</code> is the Name. The <code>DataValueField</code> is the PersonId  but <strong>I also want to bind the PersonType property</strong> so that when I retrieve the selected item from the user on the page postback:</p>
  
  <pre><code>       ListItemCollection items = ListBox1.Items;
          foreach (ListItem item in items)
          {
              if (item.Selected == true)
              {
                  // Here I want to retrive also
                  // the PersonType attribute
                  string personType = item.????
              }
          }  
  </code></pre>
  
  <p>How can I achieve that?</p>