troubleshooting Question

ASP Iteration for a Web Page Carousel populated from a Database

Avatar of souldj
souldj asked on
ASP
3 Comments1 Solution369 ViewsLast Modified:
I have a carousel display on a web page that I want to have populated from a database but I do not know how to get it to choose 3 items per page of the carousel before moving to the next page.

This is the carousel in HTML

<div class="sliderBox">
          <a class="arrow" href="#"></a>
               <div class="carousel">
                      <ul class="list">
                        <li>
                          <div><img src="images/img1.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>17.99</strong> </li>
                        <li>
                          <div><img src="images/img2.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>13.99</strong> </li>
                        <li>
                          <div><img src="images/img3.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>25.99</strong> </li>
                      </ul>
                      <ul class="list">
                        <li>
                          <div><img src="images/img1.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>17.99</strong> </li>
                        <li>
                          <div><img src="images/img2.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>13.99</strong> </li>
                        <li>
                          <div><img src="images/img3.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>25.99</strong> </li>
                      </ul>
                      <ul class="list">
                        <li>
                          <div><img src="images/img1.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>17.99</strong> </li>
                        <li>
                          <div><img src="images/img2.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>13.99</strong> </li>
                        <li>
                          <div><img src="images/img3.gif" alt="" /></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font>25.99</strong> </li>
                      </ul>
                  </div>    
          <a class="arrowR" href="#"></a>
          <div class="clr"></div>
        </div>


I then thinned it down to put my ASP Code


<div class="sliderBox">
          <a class="arrow" href="#"></a>
               <div class="carousel">
             <%
             
Set objDB = Server.CreateObject("ADODB.Connection")
objDB.Open DB_CON

MySQL="Select * from products where displayincarousel=TRUE "


Set ObjRs=objDB.Execute(MySQL)

if objrs.eof then
' No images in the database for the carousel



else
%>

<%

Do While not Objrs.EOF

%>
 <ul class="list">
                        <li>
                          <div><a href="productdetails.asp?intProdID=<%=objrs("productid") %>&SubCatalogID=<%=objrs("subcatalogID") %>">
                      <img src="shopproductimages/<%=objrs("productImg") %>" alt="<%=objrs ("productName") %>" width="150" height="200" /></a></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font><%=objrs("productPrice") %></strong> </li>
                        <li>
                          <div><a href="productdetails.asp?intProdID=<%=objrs("productid") %>&SubCatalogID=<%=objrs("subcatalogID") %>">
                      <img src="shopproductimages/<%=objrs("productImg") %>" alt="<%=objrs ("productName") %>"  width=150  height="200" /></a></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font><%=objrs("productPrice") %></strong> </li>
                        <li>
                          <div><a href="productdetails.asp?intProdID=<%=objrs("productid") %>&SubCatalogID=<%=objrs("subcatalogID") %>">
                      <img src="shopproductimages/<%=objrs("productImg") %>" alt="<%=objrs ("productName") %>" width=150  height="200" /></a></div>
                          <small>Starting At</small> <strong><font color="green">=N=</font><%=objrs("productPrice") %></strong> </li>
                      </ul>





<%
Objrs.MoveNext
Loop




end if


objRS.close()
Set objRS = Nothing
             
              %>
                     
                   
                  </div>    
          <a class="arrowR" href="#"></a>
          <div class="clr"></div>
        </div>


But it displays 3 of the same products six times and not 3 products per page .

Please help.
ASKER CERTIFIED SOLUTION
magadesign_sviluppo

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Join our community to see this answer!
Unlock 1 Answer and 3 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 1 Answer and 3 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange.

-Mike Kapnisakis, Warner Bros