1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Help with record count

Discussion in 'C#' started by danjapro, Aug 4, 2009.

  1. #1
    I would like to break my record set display after every three(3) records. With MAx of (9) records, which is set,
    Currently it continues to layout in row, does not make a new line after three records. HELP, PLEASE

    <%
    'DIM iRecordCount
    iRecordCount = 0
    
    DO WHILE NOT objRS.EOF and iRecordCount <> 9
    
    %>
    	<td  class="" style="background-image: url(<% =objRS("Thumbnail") %>); background-repeat:repeat; width: 275px; height: 138px;" >
    		
    	    <div class="FieldDiv">
    		<%if RelatedURL = "" then%>
    		<a href="register.asp?Action=Signup" alt="<% =objRS("ContentTitle") %>" class="FieldFont">
    		SIGN-UP HERE!</a>
    		
    		
    		<%else%>
    		<a href="<% =objRS("RelatedURL") %>" alt="<% =objRS("ContentTitle") %>" class="FieldFont">
    		SIGN-UP HERE!</a>
    		
    		<%end if%>
    		
    		</div>
    
    	</td>
    	
     <%
    iRecordCount = iRecordCount + 1
    objRS.MoveNext
    Loop
    
    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn = Nothing
    %>
    </tr>
    </table> 
    Code (markup):
     
    danjapro, Aug 4, 2009 IP
  2. danjapro

    danjapro Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I tried adding this in and get an a error, can some one tell me where should this piece of <tr> break code go before the loop:

    
     <%
     
     If (iRecordCount Mod 3) = 0 Then
    	If iRecordCount>0 Then Response.Write("</tr>")
    	Response.Write("<tr>")
    End If
     %> 
     
     <%
    iRecordCount = iRecordCount + 1
    objRS.MoveNext
    Loop
    
    objRS.Close
    Set objRS = Nothing
    objConn.Close
    Set objConn = Nothing
    %>
    
    Code (markup):
     
    danjapro, Aug 5, 2009 IP
  3. danjapro

    danjapro Peon

    Messages:
    18
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    I need to place the record count to 4, with <tr> break, How to implement??

     
    danjapro, Aug 5, 2009 IP
  4. Free Born John

    Free Born John Guest

    Messages:
    111
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    0
    #4
    If (iRecordCount Mod 3) = 0 Then
    If iRecordCount>0 Then Response.Write("</tr>")
    Response.Write("<tr>")

    how about checking for iRecordCount = 3 and then setting iRecordCount = 0 if true
     
    Free Born John, Aug 10, 2009 IP