PDA

View Full Version : ASP : Paging, really, really stumped



dinkumrocks
June 29th, 2005, 12:44 PM
I'm putting the finishing touches on this news archive. And i want the users to be able to page through the news articles.

The problem is...... (ex.) When articles 6-10 out of 12 are showing, the next button will not be displayed.

heres some code

Code:


<%If intPage > 1 then%>
<a href="default.asp?page=<%=intPage - 1%>">Prev 5</a> | <%end if%><%= countPage + 1%> - <%= countPageBig%> of <%= RS.RecordCount%>

HERES THE WHERE THE ERROR OCCURS

<%If intPage < intPageCount then%> | <a href="default.asp?page=<%=intPage + 1%>">Next 5</a><%end if%>



the Prev button works fine.

You can see the problem at www.dinkumrocks.com/news (http://www.dinkumrocks.com/news)

Im kinda stumped
-Naaman

if you change the querystring to ?page=3 it works fine.

prstudio
June 29th, 2005, 03:36 PM
http://www.asp101.com/samples/db_paging.asp

:)


if you've gotten that far - and its holding up on 6-10 there might be an error in one of the fields in 6-10 especially if its working for 1-6 and then 10-12

dinkumrocks
June 29th, 2005, 06:47 PM
OK. I've looked over what i have, and found nothing.

this is waht i have


RS.CacheSize = 5
RS.Open strSQL, Conn, 3, 3
RS.MoveFirst
RS.PageSize = 5
RS.AbsolutePage = intPage
intPageCount = RS.PageCount

now to the acutal next button


<%If intPage < intPageCount then%> | <a href="default.asp?page=<%=intPage + 1%>">Next 5</a><%end if%>



I really am lost

I might be asking too much, but would anyone be interested in looking at it and looking for errors?

thanks
-Naaman

lava
June 29th, 2005, 07:31 PM
Well, if you have 13 posts, at 5 records per page, then RS.PageCount should be return 3... have you checked what it actually returns? just in case?

one thing that might "fix" your problem is writing <%If intPage < intPageCount then%> as
<%If intPage <= intPageCount then%>. But I know that's not the real solution. I don't see the bug right away.

nite21
April 4th, 2008, 08:11 AM
Well, if you have 13 posts, at 5 records per page, then RS.PageCount should be return 3... have you checked what it actually returns? just in case?

one thing that might "fix" your problem is writing <%If intPage < intPageCount then%> as
<%If intPage <= intPageCount then%>. But I know that's not the real solution. I don't see the bug right away.



paging with aspx and actionscript
somebody help me or get some tutorial