请问谁知道百度的那种分页怎么做啊?能否给个代码学习下

来源:百度知道 编辑:UC知道 时间:2024/05/25 01:36:12
就是搜索完成后下面显示1-10页,然后不管你选几,它总是显示10个
如:32 33 34 35 36 37 38 39 40 41,这是怎么做的啊,给个思路吧。。。。。。。。。

半夜思路乱,给你点代码自己看看吧。
Set rs = Server.CreateObject("Adodb.Recordset")
rs.Open sql,conn,1,1

'翻页处理设置
pgsz=10 '一页十条信息
If pgsz < rs.RecordCount Then
ttpg = Int(rs.RecordCount / pgsz * -1)*-1
Else
ttpg = 1
End If
rs.PageSize = pgsz
rs.AbsolutePage = page
ttrs=Int(rs.RecordCount)

'实现翻页效果
If page/10 <= 1 Then
start_page=1
end_page=10
Else
start_page=Int(page/10)*10+1
If page Mod 10 = 0 Then
start_page=page-9
End If
If ttpg > start_page+9 Then
end_page=start_page+9
Else
end_page=ttpg
End If
End If
If start_page=1 Then
page_turnleft=1
page_turnright=page_turnleft+10
Else
page_turnleft=start_page-10
If ttpg > page_turnleft+20 Then
page_turnright=page_turnleft+20
Else
page_turnright=page_turnleft+10
End If
End If
If Int(page)>1 T