title: How to use asp:Table in asp:ListView LayoutTemplate ItemTemplate
body: <p>I get the following exception message when I call the DataBind() method of the ListView</p>
  
  <p><code>'Table' cannot have children of type 'ListViewDataItem'.</code></p>
  
  <p>Here's my markup</p>
  
  <pre><code>&lt;asp:ListView ID="lv" runat="server"&gt;
      &lt;LayoutTemplate&gt;
          &lt;asp:Table ID="t" runat="server" CssClass="contentframework"&gt;
              &lt;asp:TableHeaderRow&gt;
                  &lt;asp:TableHeaderCell&gt;1&lt;/asp:TableHeaderCell&gt;
                  &lt;asp:TableHeaderCell&gt;2&lt;/asp:TableHeaderCell&gt;
              &lt;/asp:TableHeaderRow&gt;
  
              &lt;asp:TableRow ID="itemPlaceHolder" runat="server" /&gt;
  
          &lt;/asp:Table&gt;
  
  
      &lt;/LayoutTemplate&gt;
  
      &lt;ItemTemplate&gt;
          &lt;asp:TableRow&gt;
              &lt;asp:TableCell&gt;&lt;%# Eval("1") %&gt;&lt;/asp:TableCell&gt;
              &lt;asp:TableCell&gt;&lt;%# Eval("2") %&gt;&lt;/asp:TableCell&gt;
          &lt;/asp:TableRow&gt;
      &lt;/ItemTemplate&gt;
  
      &lt;EmptyDataTemplate&gt;
          &lt;h2&gt;No Records!&lt;/h2&gt;
      &lt;/EmptyDataTemplate&gt;
  &lt;/asp:ListView&gt;
  </code></pre>