title: asp.net repeater data after postback
body: <p>In my .ascx control:</p>
  
  <pre><code>&lt;asp:Repeater ID="rptProducts" runat="server"&gt;
      &lt;ItemTemplate&gt;
          &lt;asp:Label ID="lblProductName" runat="server"&gt;
              &lt;%# Eval("Name") %&gt;
          &lt;/asp:Label&gt;
      &lt;/ItemTemplate&gt;
  &lt;/asp:Repeater&gt;
  
  &lt;asp:Button ID="btnGo" runat="server" Text="Postback" onclick="btnGo_Click" /&gt;
  </code></pre>
  
  <p>And in the codebehind:</p>
  
  <pre><code>protected void Page_Load(object sender, EventArgs e)
  {
      if(!this.IsPostBack){
          var products = (from p in context.Products
                          select p).Take(30);
  
          rptProducts.DataSource = products;
          rptProducts.DataBind();
      }
  }
  </code></pre>
  
  <p>And i'm wondering why my repeater looses it's data after i click that button.(postback)</p>