这是我的分页,你看下吧 你出错的原因应该是 int(Request("page")) 当Request("page") = 空值 int(空值) 会出现类型不匹配的错误. <% Dim Repeat1__numRows Dim Repeat1__index Dim page
'============ 分页开始 =================== Repeat1__numRows = 6 Recordset1.PageSize = Repeat1__numRows pagetotal = Recordset1.PageCount
if(Request.QueryString("page") <> "" ) then page = int(Request.QueryString("page")) else page = 1 end if
if page < 1 then page = 1 end if
if page >= pagetotal then page = pagetotal end if
if Recordset1.pagecount > 0 then Recordset1.Absolutepage = page end if '============ 分页导航=================== str = "每页" & Recordset1.PageSize & "条 " str = str & "共" & Recordset1_total & "条 " str = str & "页次:" & page & "/" & Recordset1.pagecount if page <= 1 then str = str & " 首页|上页|" else str = str & "<a href=?userid=" & Request.QueryString("userid") str = str & "&page=1" & ">首页</a>" str = str & "|" str = str & "<a href=?userid=" & Request.QueryString("userid") str = str & "&page=" & page - 1 & ">上页</a>" str = str & "|" end if
if page = Recordset1.pagecount then str = str & "下页|末页" else str = str & "<a href=?userid=" & Request.QueryString("userid") str = str & "&page=" & page + 1 & ">下页</a>" str = str & "|" str = str & "<a href=?userid=" & Request.QueryString("userid") str = str & "&page=" & Recordset1.pagecount & ">末页</a>" end if '============ 分页结束!=================== Repeat1__index = 0 Recordset1_numRows = Recordset1_numRows + Repeat1__numRows %>
[此贴子已经被作者于2005-6-29 14:10:50编辑过]