求给asp产品页增加分页代码

来源:百度知道 编辑:UC知道 时间:2024/05/15 12:26:31
一个asp代码没有分页功能,求大虾给增加上,感激不尽。
<!--#include file = "cninclude/conn.asp"-->
<!--#include file = "cninclude/function.asp"-->
<!--#include file="Inc/syscode.asp"-->
<%
'请勿改动下面这三行代码
ShowSmallClassType=ShowSmallClassType_Default
MaxPerPage=MaxPerPage_Default
strFileName="Product.asp?BigClassName=" & BigClassName & "&SmallClassName=" & SmallClassName
%>

<%
strKeyWord=Request("KeyWord") & ""
strKeyWrod=Replace(strKeyWord,"'","")
strKeyWord=Trim(strKeyWord)
categoryID=Request.QueryString("categoryID")
If categoryid="" Then categoryID=0
If Not (IsNumeric(ID)) Then categoryID=0

categoryID=CLng(categoryID)
strCategoryName=Request.QueryString("categoryName") & ""
strCategoryName=Trim(strCategoryName)

%>
<

<%
Set rs=Server.CreateObject("Adodb.recordset")
sql="select * from 表 order by ID desc"
rs.open sql,conn,1,1
rs.PageSize=18 '每页显示
page=Clng(request.QueryString("page"))
If page<1 then
page=1
end if
if page>rs.pagecount then
page=rs.pagecount
end if
rs.Absolutepage=page
for i=1 to rs.pagesize
%>

在此加入分面内容!!!

<%
rs.movenext
if rs.eof then
exit for
end if
next
%>

第 <font color=#990000><%=page%></font> 页 共 <font color=#990000><%=rs.pagecount%></font> 页
<%
if page=1 then
response.write "首页 "
else
response.write "<a href='此文件名.asp?page=1'>首页</a> "
end if
if page=1 then
response.write "上一页 "
else
response.write "<a href=此文件名.aspp?page=" & page-1 & ">上一