印度片大篷车:网页分页问题 150分解决追加

来源:百度文库 编辑:高校问答 时间:2024/04/30 07:38:59
rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(Request.QueryString("page"))

if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
分页每页只显示一页,怎么把index.asp?page=后面的数字改成数库是的每项的ID,
比如这个项目在数据库中ID为12,用index.asp?page=12可以打开看这个项目

rs.Open sql,conn,0,2,1 '这里执行你查询SQL并获得结果记录集
pre = true
last = true
page = trim(rs("id"))

if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if

上面intpage不是得到数据库的页数了吗?

如楼上所说。你的问题不是已经解决了吗?不知道你问的是什么问题

<%=rs("id")%>