Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5

Thread: asp repeat.

  1. #1
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts

    asp repeat.

    hey guys, i was wondering how to do a .asp repeat that instead of just listing items down the page it lists 3 items per row then drops down a line...
    Code:
    eg. 
    1      2      3
    4      5      6
    7      8      9
    thanks in advance,

    -baleric
    Last edited by Baleric; 04-30-2006 at 02:55 AM.

  • #2
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ok i have figured out how to do the tables and list the records in the table,
    but the thing is it lists the 1st record over and over again,
    and when i try to add a repeat it stuffs the whole thing up,
    do i also need a code that basically says "if theres no more records stop"

    here is my code so far.

    Code:
    <table border="1" cellpadding="10" bordercolor="#0000FF">
    
    	<%
    
    	for i = 1 to 3
    		%>
    		<tr>
    		<%
    			for j = 1 to 3
    			%>
    			<td>	<%=Itemsrs("Product")%>		</td>
    			<%
    			next
    		%> 
    		</tr>
    		<%
    	next
    
    
    	%>
    
    	</table>

  • #3
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    all done...

    Code:
    <table border="1" cellpadding="5" bordercolor="#0000FF">
    
    <%
    DO WHILE NOT rs.EOF
    	Response.Write("<tr>")
    
    	FOR i = 1 TO 3
    	%>
    		<td>
    		<%
    			IF rs.EOF THEN
    			%>
    				No Record
    			<%
    			ELSE
    			%>
    			<%= rs("Product") %>
    			<%
    			rs.MoveNext
    			END IF
    		%>
    		</td>		
    	<%
    	NEXT
    
    	Response.Write("</tr>")
    LOOP %>
    	</table>

  • #4
    Senior Coder
    Join Date
    Nov 2002
    Location
    North-East, UK
    Posts
    1,265
    Thanks
    0
    Thanked 0 Times in 0 Posts

  • #5
    Regular Coder Baleric's Avatar
    Join Date
    Feb 2005
    Location
    Australia
    Posts
    332
    Thanks
    0
    Thanked 0 Times in 0 Posts
    that looks better and look like you have more control over what u are doing,

    thank alot

    cheers

    baleric


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •