title: ASP.NET create repeater programmatically
body: <p>I'm trying to create an ASP:Repeater programmatically and I have a problem when trying to bind the columns. The tutorials I've read are quite confusing and many of them don't get to the point of binding.</p>
  
  <p>My problem is only in the point of binding data, when I would write this in a "static" repeater:</p>
  
  <pre><code>&lt;%# DataBinder.Eval(Container.DataItem, "Name")%&gt;
  </code></pre>
  
  <p>I don't know what should be when working in code-behind, it's within a class so I don't have an event handler. This is my code so far:</p>
  
  <pre><code>Dim DsArbol As New SqlDataAdapter(query, System.Configuration.ConfigurationManager.ConnectionStrings("CNX").ConnectionString)
  
      Dim tablaCarpetas As New DataTable
      DsArbol.Fill(tablaCarpetas)
  
      Dim RepArbol As New Repeater
      RepArbol.DataSource = tablaCarpetas
      RepArbol.ID = "repArbolCarpetas"
  
      Dim header As New TemplateBuilder
      Dim item As New TemplateBuilder
      Dim footer As New TemplateBuilder
  
      header.AppendLiteralString("&lt;ul class=""arbol-carpetas""&gt;")
      item.AppendLiteralString(String.Format("&lt;li id=""li_carpeta_{0}""&gt;{1}&lt;/li&gt;", 1, DataBinder.Eval(Container.DataItem, "Name")))
      footer.AppendLiteralString("&lt;/ul&gt;")
  
      RepArbol.HeaderTemplate = header
      RepArbol.ItemTemplate = item
      RepArbol.FooterTemplate = footer
  
      RepArbol.DataBind()
      PanelArbolCarpetas.Controls.Add(RepArbol)
  </code></pre>
  
  <p>What should I write instead of <code>DataBinder.Eval(Container.DataItem, "Name")</code>?</p>