title: How to bind linq query to a repeater?
body: <p>I'm doing a search for name and surname via linq and I want to bind the results to a repeater.</p>
  
  <p>What am I doing wrong?</p>
  
  <pre><code>// this the results for list
  
  public static List&lt;SearchResults&gt; lsSearchResults = new List&lt;SearchResults&gt;();
  
  public class SearchResults
          {
              public string Name { get; set; }
              public string Surname { get; set; }
  
              public SearchResults(string name, string surname)
              {
                  Name = name;
                  Surname = surname;
              }
  
          }
  
  // search button
  protected void btnSearch_Click(object sender, EventArgs e)
          {
  
              var found = (from User in myDB.Memberships
                           where User.Name.ToLower().Contains(txtSearch.Text.ToLower()) ||
                           User.Surname.ToLower().Contains(txtSearch.Text.ToLower())
                           select new { User.Name, User.Surname });
  
              // validates items in search query if Exist
              if (!ChillZARdev.App_Code.Utilities.IsEmpty(found))
              {
                  foreach (var user in found)
                  {
                      lsSearchResults.Add(new SearchResults(user.Name, user.Surname));
                      // ls.Add(user.Name + " " + user.Surname);
  
                      // Response.Write(user);
                  }
                  Repeater1.DataSource = lsSearchResults;
  
                  Repeater1.DataBind();
  
               }
            }
  
          private bool IsEmpty(object found)
          {
              throw new NotImplementedException();
          }
  
          protected void Repeater1_ItemDataBound(object sender, RepeaterItemEventArgs e)
          {
  
              if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
              {
  
                WAT THE HELL I PUT IN HERE ?? LOL for this ish to work
                        CLUELESS
  
              }
  </code></pre>
  
  <p>This is the HTML code of the repeater:</p>
  
  <pre><code>      &lt;asp:Repeater ID="Repeater1" runat="server" onitemdatabound="Repeater1_ItemDataBound"&gt;
          &lt;HeaderTemplate&gt;
          &lt;table&gt;
           &lt;tr&gt;
           &lt;td&gt;
          &lt;asp:Label ID="Label6" runat="server" Text='&lt;%#Eval("Name")%&gt;'&gt;&lt;/asp:Label&gt;
          &lt;asp:Label ID="Label5" runat="server" Text='&lt;%#Eval("Surname")%&gt;'&gt;&lt;/asp:Label&gt;
          &lt;/td&gt;
          &lt;td&gt;
          &lt;/td&gt;
          &lt;/tr&gt;
  
          &lt;/table&gt;
          &lt;/HeaderTemplate&gt;
  
  
          &lt;/asp:Repeater&gt;
  </code></pre>