If PageCount ist reached, start from First Page ( ASP Classic )

asms

New Member
I have an Active Server Page, which displays Booking of the current Day. I setted the PageSize to two, so my display is displaying just 2 bookings per side, if there are more Records. So actually i have 8 bookings in my Recordset, so my ASP creates 4 Pages. I wrote the following function:\[code\]Function getNext10(num)getNext10 = CurrPage + 1End Function\[/code\]Finally i call that function in a meta tag, to automatically change the pages:\[code\]<meta http-equiv="refresh" content="10;URL=paging.asp?PageNo=<% Response.Write(getNext10(CurrPage))%>" />\[/code\]It is working like charm. But i have just one more Problem. If i do that like this the PageNo is increment endless.My PageCount is 4. So what i need in my function is a logic which checks whether the PageCount has been reached or not. If yes then he should start from the first page again, if not then increment until pagecount has reached. Can someone help me with that? Thanks!!EDIT:I Wrote that function:\[code\]Function getNext10(num) getNext10 = num if getNext10 < i then // In `i`, i have my pagecount (4), which i got from Recordset.PageCount // I checked it with Response.Write() getNext10 = CurrPage + 1 End if End Function\[/code\]If i use \[code\]i\[/code\] the if clause is not working, i dont know why. Its only working if i use directly a number.
 
Back
Top