Avatar of Destiny Amana
Destiny Amana
Flag for Nigeria asked on

ASP Iteration for a Web Page Carousel populated from a Database

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.
ASP

Avatar of undefined
Last Comment
Destiny Amana

8/22/2022 - Mon
ASKER CERTIFIED SOLUTION
magadesign_sviluppo

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.
Destiny Amana

ASKER

Excellent

Thanks
Destiny Amana

ASKER
Excellent

Thanks
Experts Exchange is like having an extremely knowledgeable team sitting and waiting for your call. Couldn't do my job half as well as I do without it!
James Murphy