title: Show product details in page
body: <p>I need to show products details in a page.</p>
  
  <p>My <code>aspx</code> is like below...</p>
  
  <pre><code>&lt;div class="col-xs-12 col-sm-4 no-margin product-item-holder hover"&gt; &lt;!-- this div will be repeated for each product --&gt;
  &lt;div class="product-item"&gt;
      &lt;div class="image"&gt;
          &lt;img runat="server" id="img" alt="" src="" /&gt;
      &lt;/div&gt;
      &lt;div class="body"&gt;
          &lt;div class="label-discount clear"&gt;&lt;/div&gt;
          &lt;div class="title"&gt;
              &lt;a runat="server" id="name" href="single-product.html"&gt;&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="prices"&gt;
          &lt;div class="price-prev"&gt;&lt;/div&gt;
          &lt;div runat="server" id="price" class="price-current pull-right"&gt;&lt;/div&gt;
      &lt;/div&gt;
      &lt;div class="hover-area"&gt;
          &lt;div class="add-cart-button"&gt;
              &lt;a href="single-product.html" class="le-button"&gt;Enquiry&lt;/a&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  &lt;/div&gt;
  </code></pre>
  
  <p></p>
  
  <p>and my codebehind is like below...</p>
  
  <pre><code>dbConnection cn = new dbConnection();
  protected void Page_Load(object sender, EventArgs e)
  {
      if (!IsPostBack)
      {
          getLoopData();
      }
  }
  
  public void getLoopData()
  {
      cn.con.Open();
      cn.cmd.Connection = cn.con;
      cn.cmd.CommandText = "select * FROM products";
      MySqlDataReader reader = cn.cmd.ExecuteReader();
  
      while (reader.Read())
      {
          //int id = reader.GetInt32(0);
          name.InnerText = reader["InventionName"].ToString();
          price.InnerText = reader["Price"].ToString();
          img.Src = reader["Picture"].ToString();
  
      }
      reader.Close();
      cn.con.Close();
  }
  </code></pre>
  
  <p>But it is showing only last product details.</p>
  
  <p>How should I repeat the <code>div</code> for each product and how to show every products in page ??</p>