title: Displaying multiple images of a product in a Datalist Cell
body: <p>I have a project in which i have to display products like Ecommerce website (with sliding multiple images).</p>
  
  <p>There i want to display multiple images of each product within a Cell.</p>
  
  <p>I have 2 tables named Product_Master &amp; Product_Images as follows:-</p>
  
  <p><strong>Product_Master :-</strong></p>
  
  <p><strong>Id Pcode Pname MRP DP</strong></p>
  
  <p>1 1234 Samsung Mobile 20000 18000</p>
  
  <p>2 2345 Mi Mobile 15000 14000</p>
  
  <p>3 3456 Realme Mobile 12000 10000</p>
  
  <p>4 4567 Nokia Mobile 9000 8000</p>
  
  <p><strong>Product_Images :-</strong></p>
  
  <p><strong>Id Pcode ImgName</strong></p>
  
  <p>1 1234 Samsung1.jpg</p>
  
  <p>2 1234 Samsung2.jpg</p>
  
  <p>3 1234 Samsung3.jpg</p>
  
  <p>4 1234 Samsung4.jpg</p>
  
  <p>5 2345 Mi1.jpg</p>
  
  <p>6 2345 Mi2.jpg</p>
  
  <p>7 2345 Mi3.jpg</p>
  
  <p>8 3456 Realme1.jpg</p>
  
  <p>9 3456 Realme2.jpg</p>
  
  <p>10 4567 Nokia1.jpg</p>
  
  <p>11 4567 Nokia2.jpg</p>
  
  <p>12 4567 Nokia3.jpg</p>
  
  <p><strong>After joing these tables I got 12 rows in datatable</strong></p>
  
  <p><strong>Product_Images.Id--Product_Master.Pcode--Product_Images.ImgName--Product_Master.Pname--Product_Master.MRP--Product_Master.DP</strong></p>
  
  <p>1 1234 Samsung1.jpg Samsung Mobile 20000 18000</p>
  
  <p>2 1234 Samsung2.jpg Samsung Mobile 20000 18000</p>
  
  <p>3 1234 Samsung3.jpg Samsung Mobile 20000 18000</p>
  
  <p>4 1234 Samsung4.jpg Samsung Mobile 20000 18000</p>
  
  <p>5 2345 Mi1.jpg Mi Mobile 15000 14000</p>
  
  <p>6 2345 Mi2.jpg Mi Mobile 15000 14000</p>
  
  <p>7 2345 Mi3.jpg Mi Mobile 15000 14000</p>
  
  <p>8 3456 Realme1.jpg Realme Mobile 12000 10000</p>
  
  <p>9 3456 Realme2.jpg Realme Mobile 12000 10000</p>
  
  <p>10 4567 Nokia1.jpg Nokia Mobile 9000 8000</p>
  
  <p>11 4567 Nokia2.jpg Nokia Mobile 9000 8000</p>
  
  <p>12 4567 Nokia3.jpg Nokia Mobile 9000 8000</p>
  
  <p>Now I want to display 4 Cells for products which contains </p>
  
  <ul>
  <li><p><strong>Product Name on Label</strong> </p></li>
  <li><p><strong>Product Code on Label</strong> </p></li>
  <li><p><strong>Multiple Images with slider in Repeater or any other control/</strong> </p></li>
  <li><p><strong>Dp on Label</strong> </p></li>
  <li><p><strong>MRP on Label.</strong></p></li>
  </ul>
  
  <p>Here I am Attaching my Code for binding the data with datalist &amp; its repeater. After appyling the given code I got 12 Cells which contains Same Information of products with different images.</p>
  
  <p>But I want to show each Product Information with its multiple images as slider  in a Single cells. Means i want to display 4 cells in which product image can slide... </p>
  
  <p><strong>Please help me out.</strong></p>
  
  <p>I hope you will understand my concern....</p>
  
  <p>Thanks</p>
  
  <pre><code>&lt;asp:DataList ID="DatListProduct" runat="server" OnItemDataBound="DatListProduct_ItemDataBound"&gt;
  &lt;ItemTemplate&gt;
      &lt;asp:Label ID="lblProdName" runat="server" Font-Bold="true" Font-Size="Medium" Text='&lt;%# Eval("Pnamae")%&gt;'&gt;&lt;/asp:Label&gt;
      &lt;asp:Label ID="lblProdPcode" runat="server" Font-Bold="true" Font-Size="Medium" Text='&lt;%# Bind("Pcode") %&gt;' Visible="false"&gt;&lt;/asp:Label&gt;
      &lt;asp:Repeater ID="InnerRepeaterCourseResults" runat="server"&gt;
          &lt;ItemTemplate&gt;
              &lt;asp:Image ID="ImgProdImg" runat="server" Height="220px" ImageUrl='&lt;%# Eval("imgname", "~Gallery/{0}")%&gt;' Width="220px" /&gt;
          &lt;/ItemTemplate&gt;
      &lt;/asp:Repeater&gt;
      &lt;asp:Label ID="lblProdDP" runat="server" Font-Bold="true" Font-Size="Large" Text='&lt;%# Bind("DP") %&gt;'&gt;&lt;/asp:Label&gt;
      &lt;asp:Label ID="lblProdMRP" runat="server" Font-Bold="false" Font-Strikeout="true" Font-Size="Medium" Text='&lt;%# Bind("MRP") %&gt;'&gt;&lt;/asp:Label&gt;
  &lt;/ItemTemplate&gt;
  </code></pre>
  
  <p></p>
  
  <pre><code>    Private Sub DataListProducts()
          Dim da As New SqlDataAdapter
          Dim ds As New DataSet
          da = New SqlDataAdapter("SELECT Product_Images.Id, 
          Product_Master.Pcode, Product_Images.Imgname, 
          Product_Master.Pname, 
          Product_Master.MRP, Product_Master.DP FROM Product_Master INNER 
          JOIN Product_Images ON Product_Master.Pcode = 
          Product_Images.Pcode", con)
          Dim dt As New DataTable
          da.Fill(dt)
          Dim dtp As New DataTable()
          dtp.Columns.AddRange(New DataColumn(5) {New 
          DataColumn("Id",GetType(Integer)), 
          New DataColumn("Pcode", GetType(String)), 
          New DataColumn("Pname", GetType(String)), 
          New DataColumn("MRP", GetType(Decimal)), 
          New DataColumn("DP", GetType(Decimal)), 
          New DataColumn("Imgname", GetType(String))})
          For i = 0 To (foundRows.Count - 1)
              dtp.Rows.Add(foundRows(i)("Id"), foundRows(i)("Pcode"), 
              foundRows(i)("Pname"), foundRows(i)("MRP"), foundRows(i) 
              ("DP"), foundRows(i)("Imgname"))
          Next
          Session("dtp") = dtp
          DatListProduct.DataSource = dtp
          DatListProduct.DataBind()
      End Sub
  
      Protected Sub DatListProduct_ItemDataBound(sender As Object, e As 
      DataListItemEventArgs)
          Dim dtp As New DataTable()
          dtp.Columns.AddRange(New DataColumn(5) {New DataColumn("Id", 
          GetType(Integer)), New DataColumn("Pcode", GetType(String)), New 
          DataColumn("Pname", GetType(String)), New DataColumn("MRP", 
          GetType(Decimal)), New DataColumn("DP", GetType(Decimal)), New 
          DataColumn("Imgname", GetType(String))})
          dtp = Session("dtp")
          If e.Item.ItemType = ListItemType.Item OrElse e.Item.ItemType = 
          ListItemType.AlternatingItem Then
                Dim Pcode As String = 
                (TryCast(e.Item.FindControl("lblProdPcode"), Label)).Text
                Dim InnerRepeaterCourseResults As Repeater = 
                TryCast(e.Item.FindControl("InnerRepeaterCourseResults"), 
                Repeater)
                InnerRepeaterCourseResults.DataSource = dtp.[Select]("Pcode=" &amp; 
                Pcode &amp; "").CopyToDataTable()
                InnerRepeaterCourseResults.DataBind()
         End If
      End Sub
  </code></pre>