Morgoth
03-29-2003, 07:07 PM
Hello,
I am trying to figure out the best method of laying out pages for records...
Such as if I were to have a news section where a person can post messages, and to take less space, it will only show 5 records then any other records would have to be on a new page (most likly with a qeurystring ?page=2)
And on page 2, it will show the next 5 records...
Does anyone have a good method for something like this? I have been trying to figure out one for myself, but came up short with problems, and mistakes I didn't understand..
I am going to try more of this, and I will post any results that I come up with...
One method I had but scraped half way through was this:
(As you can see it's only test code)
Dim IntTestCount , PageNumber
PageNumber = Request.QueryString("page")
If PageNumber = "" Then
PageNumber = 1
End If
Do Until oRS.EOF
IntTestCount = IntTestCount + 1
If IntTestCount = 1 Then
Response.Write "<a href=""news.asp?page=1"">1 </a>"
ElseIf IntTestCount = 6 Then
Response.Write "<a href=""news.asp?page=2"">2 </a>"
End If
oRS.MoveNext
Loop
oRS.MoveFirst
IntTestCount = 0
oRS.Move((PageNumber-1)*5)
I have another idea that I am goint o start working on now..
I am trying to figure out the best method of laying out pages for records...
Such as if I were to have a news section where a person can post messages, and to take less space, it will only show 5 records then any other records would have to be on a new page (most likly with a qeurystring ?page=2)
And on page 2, it will show the next 5 records...
Does anyone have a good method for something like this? I have been trying to figure out one for myself, but came up short with problems, and mistakes I didn't understand..
I am going to try more of this, and I will post any results that I come up with...
One method I had but scraped half way through was this:
(As you can see it's only test code)
Dim IntTestCount , PageNumber
PageNumber = Request.QueryString("page")
If PageNumber = "" Then
PageNumber = 1
End If
Do Until oRS.EOF
IntTestCount = IntTestCount + 1
If IntTestCount = 1 Then
Response.Write "<a href=""news.asp?page=1"">1 </a>"
ElseIf IntTestCount = 6 Then
Response.Write "<a href=""news.asp?page=2"">2 </a>"
End If
oRS.MoveNext
Loop
oRS.MoveFirst
IntTestCount = 0
oRS.Move((PageNumber-1)*5)
I have another idea that I am goint o start working on now..