title: DataTable and ASP.NET Repeater
body: <p>I am binding a DataTable to a repeater. However when I run my aspx page it is not evaluating the Eval statements and displaying them on the page as</p>
  
  <pre><code>&lt;&lt;%# Eval("Name").ToString() %&gt; Posted by: &lt;&lt;%# Eval("UserName").ToString() %&gt;
  &lt;&lt;%# Eval("Name").ToString() %&gt; Posted by: &lt;&lt;%# Eval("UserName").ToString() %&gt;
  &lt;&lt;%# Eval("Name").ToString() %&gt; Posted by: &lt;&lt;%# Eval("UserName").ToString() %&gt;
  </code></pre>
  
  <p>It is also breaking it down to 3 rows. Which is also not what I had expected. I thought it would display as spans normally would</p>
  
  <p>I have taken out the .ToString to check if it was that causing the issue. But it was not.</p>
  
  <p>Below is my Repeater</p>
  
  <pre><code>&lt;asp:Repeater ID="First" runat="server"&gt;
          &lt;ItemTemplate&gt;
              &lt;div class="ItemDiv"&gt;
                  &lt;span class="ItemLeft"&gt;&lt;/span&gt;
                  &lt;span class="ItemCentre"&gt;
                      &lt;asp:Label ID="Name" runat="server" Text='&lt;&lt;%# Eval("Name").ToString() %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/span&gt;
                  &lt;span class="ItemRight"&gt;
                      &lt;asp:Label ID="UserName" runat="server" Text='&lt;&lt;%# Eval("UserName").ToString() %&gt;'&gt;&lt;/asp:Label&gt;
                  &lt;/span&gt;
              &lt;/div&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
  </code></pre>
  
  <p>The code to bind is the following:</p>
  
  <pre><code>public void dataLoad()
  {
      DataTable Data = loadData(1,1,1);
  
      if (Data.Rows.Count &lt; 10)
      {
          // Only populate the data from datatable
          First.DataSource = Data;
          First.DataBind();
          Second.Visible = false;
          noData.Visible = true;
      }
  </code></pre>
  
  <p>I have changed some of the names in the above example</p>
  
  <p>In the Debug information I can see that my DataTable is using the correct column names, and that these match my eval statements.</p>
  
  <p>I know I have created this in a rather strange way, from what I have read, and researched online it is more common to use a table rather than Divs/or Spans for this. So I am aware that that may be the problem at its heart.</p>
  
  <p>I cannot see why it would be any different.</p>