title: How to Bind List<string> into ListView in WebForms
body: <p>I have a <code>List&lt;string&gt;</code> collection that I would like to bind into my <code>ListView</code>.</p>
  
  <p>Below is the markup for my <code>ListView</code>:</p>
  
  <pre><code>&lt;asp:ListView ID="lvList" runat="server"&gt;
  
          &lt;LayoutTemplate&gt;         
              &lt;div id="Div1" runat="server"&gt;              
                  &lt;div ID="itemPlaceholder" runat="server"&gt;              
                  &lt;/div&gt;         
              &lt;/div&gt;      
          &lt;/LayoutTemplate&gt;
  
          &lt;EmptyDataTemplate&gt;         
              &lt;div id="Div2" runat="server"&gt;              
                  &lt;div ID="itemPlaceholder" runat="server"&gt;                 
                  No data was returned.             
                  &lt;/div&gt;         
              &lt;/div&gt;      
          &lt;/EmptyDataTemplate&gt;
  
          &lt;ItemTemplate&gt;
              &lt;asp:Label ID="ProductNameLabel" runat="server" Text='&lt;%# Eval ("theList") %&gt;'/&gt;
          &lt;/ItemTemplate&gt;
  
  &lt;/asp:ListView&gt;
  </code></pre>
  
  <p>in my CodeBehind:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {         
      List&lt;string&gt; theList = new List&lt;string&gt;();
      //populate members of list
      lvList.DataSource = theList;
      lvList.DataBind();
  }
  </code></pre>
  
  <p>Error Message:</p>
  
  <blockquote>
    <p>System.Web.HttpException was unhandled by user code<br>
    Message="DataBinding: 'System.String' does not contain a property with
    the name 'theList'."</p>
  </blockquote>
  
  <p>I think I am doing things wrongly here, can someone advise me pls?</p>