title: Binding a generic list to a repeater - ASP.NET
body: <p>I am trying to bind a <code>List&lt;AreaField&gt;</code> to a repeater. I have converted the list into an array by using the <code>ToArray()</code> method and now have a array of <code>AreaField[]</code></p>
  
  <p>Here's my class hierarchy</p>
  
  <pre><code>public class AreaFields
  {
      public List&lt;Fields&gt; Fields { set; get; }
  }
  
  public class Fields
  {
      public string Name { set; get; }
      public string Value {set; get; }
  }
  </code></pre>
  
  <p>In the aspx, I would like to bind it a repeater (something like this)</p>
  
  <pre><code>DataBinder.Eval(Container.DataItem, "MyAreaFieldName1")
  </code></pre>
  
  <p>The MyAreaFieldName1 is the value of the Name property in the AreaFieldItem class.</p>