If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

 
Go Back  dBforums > Data Access, Manipulation & Batch Languages > ASP > Paging recordsets

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old 01-05-05, 00:18
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
Join Date: Jul 2004
Posts: 494
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?
Reply With Quote
  #2 (permalink)  
Old 01-09-05, 16:28
jaywhy13 jaywhy13 is offline
Registered User
 
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
Reply With Quote
  #3 (permalink)  
Old 01-09-05, 18:09
gilgalbiblewhee gilgalbiblewhee is offline
Registered User
 
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%>
Reply With Quote
  #4 (permalink)  
Old 01-09-05, 20:39
DrewM DrewM is offline
Registered User
 
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 20:42.
Reply With Quote
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On