Classic ASP - Displaying page numbers in pagination
Im a very very newbie at ASP, but im trying to work out pagination.
So far im displaying 10 images per page and then just displaying the
'prev' and 'next' links at the bottom of the page which works perfect.
But i would like to display the amount of pages in between the prev and
next links .. i cant seem to get anything working.
What i have so far is as follows, if someone could help out i would be
very grateful.
Dim page
pageSize = 10
page = Request("page")
if len(page) = 0 then page = 0
if not(isNumeric(page)) then page = 0
'Enter pagination for loop
start = page * pageSize
finish = start + pageSize - 1
for current = start to finish
if current < ubound(arrMultiImages) then
Response.Write "<img src='" & arrMultiImages(current,1) &
"'><br />" & vbCrLf
end if
next
if start > 0 then response.write "<a href=""" & urlPage & "?page=" &
page - 1 & """>Prev</a><br>"
if finish < ubound(arrMultiImages) then response.write "<a href=""" &
urlPage & "?page=" & page + 1 & """>Next</a>"
No comments:
Post a Comment