Results 1 to 4 of 4
  1. #1
    Join Date
    Jul 2004
    Posts
    494

    Unanswered: Paging recordsets

    Let's say you have pages 1 | 2 | 3 | 4 | 5 and you're on page 3. How do you make the code so that 3 will be without url?

  2. #2
    Join Date
    Dec 2004
    Posts
    7
    Quote Originally Posted by gilgalbiblewhee
    Let's say you have pages 1 | 2 | 3 | 4 | 5 and you're on page 3. How do you make the code so that 3 will be without url?
    Okay, I'm thinking this:
    If the line "1 | 2 | 3 | ......" is generated by ASP code then it can easily be done!!!

    You could do a test for each one, say
    if pageLocation = location_in_url then
    response.write "<a name=......">
    else
    response.write "<a href="....">
    end if

  3. #3
    Join Date
    Jul 2004
    Posts
    494
    What in this case is "pageLocation" and "location_in_url"? I think one is "i" right? Then what's the other? I was having trouble making it work.

    Code:
    <%
    if rspage>2 then
    
               for i=1 to rspage
    pagingurl = "<a href=""" & Request.ServerVariables("SCRIPT_NAME") & "?page=" &i& "&Keyword="& Keyword &"&Keywordb="& Keywordb &"&Keywordc="& Keywordc
    
    if spoke<> "" then pagingurl = pagingurl & "&spoke=" & spoke
    
    
    If   request.QueryString("book_spoke")="Book_Spoke" then pagingurl = pagingurl & "&book_spoke=Book_Spoke"
    
    If   request.QueryString("chapter_spoke")="Chapter_Spoke" then pagingurl = pagingurl & "&chapter_spoke=Chapter_Spoke"
    
    If   request.QueryString("verse_spoke")="Verse_Spoke" then pagingurl = pagingurl & "&verse_spoke=Verse_Spoke"
    If Trim(Request.QueryString("recordType")) <> "" then 
      aRecTypes = Split(Request.QueryString("recordType"), ",")
        For iLoopCount = 0 To UBound(aRecTypes)
         pagingurl = pagingurl & "&recordType=" & trim(aRecTypes(iLoopCount))
        Next
      End If
      SQL = SQL & ")"
    
    pagingurl = pagingurl & "&text_data=yes" & "&optAction=on"">"&i&"</a> "
    
    response.write pagingurl
    
    
    Response.Write "&nbsp;|&nbsp;"
               next
    
         end if%>

  4. #4
    Join Date
    Jan 2005
    Posts
    36
    You could also do something like this

    <% currentpage = request("page") %>
    .
    .
    .
    .
    .
    <%For i = 1 to totalnumberofpages
    if i = currentpage then %>
    | <%=i%> |
    <% else %>
    | <a href="thispage.asp?page=<%=i>><%=i%></a> |
    <% end if
    next %>

    where totalnumberofpages is something you either set or calc earlier in the page - this is the total number of pages

    currentpage is the current page number.
    Last edited by DrewM; 01-09-05 at 21:42.

Posting Permissions

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