请教分页跳转后查询范围的设定问题。
我做了个ASP带库的网站,情况是这样的,我们的产品分类有3层:先是大类(TYPE) ; 然后是小类(NTYPE);最后是产品(PRODUCT)我遇到的问题是:分页显示后我只要任意点击一个页码链接,他跳转后就把所有大类里面的产品给显示出来了,而我要求的是跳转后只显示小类里面的产品。
希望我说的大家能明白。
网站地址如下:http://www.
希望各位能给我这个菜鸟指路…… 万分感谢!
本人QQ:122022998 望不吝赐教!
<%
'============================================================
' ********************数字分页涵数********APJE.2008-10-01
'SQL: 查询语句
'PageSizeN: 每页显示多少记录
'classid: 栏目ID
'PageCountSS: 总页数
'thispage: 当前页码
'StarP: 开始页码
'EndP: 结束页码
'ShowPage: 每页显示多少个数字页码
'vvv: 循环体的各个页码
'RecordCountS: 记录集的总记录数
'pa分页参数
'============================================================
Function PageStr(SQLa,PageSizeN,classid,thispage,pa1)
dim RecordCountS,PageCountSS,ShowPage,StarP,EndP,i,upPage,NextPage,sqlstr,vvv,BasePage
Set RsPage = Server.CreateObject("adodb.Recordset")
RsPage.open SQLa,con,1,1
RecordCountS = RsPage.recordcount
if RecordCountS <> 0 Then
ShowPage = 8
PageCountSS = Int(RecordCountS/PageSizeN)
IF (RecordCountS Mod PageSizeN) > 0 Then
PageCountSS = PageCountSS+1
end if
If thispage > PageCountSS Then thispage = PageCountSS
vvv = thispage
StarP = ThisPage-(ShowPage/2)+1
IF StarP < 1 Then
StarP = 1
end if
EndP = ThisPage+(ShowPage/2)
IF EndP > PageCountSS Then
EndP = PageCountSS
end if
'****************循环输出页码
BasePage = (thispage \ showpage) * showpage
if thispage mod showpage = 0 then basepage = ( basepage \ showpage ) * showpage - showpage
For i = 1 to showpage
Dim Showstr
vvv = BasePage + i
if vvv > PageCountSS Then exit for
if vvv = thispage then
Showstr = Showstr & "<span class='STYLE2'><strong>[" & vvv & "]</strong></span>"
else
Showstr = Showstr & "<a href='product1.asp?type=list&classid=" & classid & "&page=" & vvv &pa& "'>[" & vvv & "]</a>"
End If
Next
'***************开始部分
upPage = ThisPage - 1
If ThisPage < 2 Then
Showstr = "<span style='font-family:Webdings'>9</span> <span style='font-family:Webdings'>7</span> " & Showstr
Else
Showstr = "<a href='product1.asp?type=list&classid="&classid&"&page=1"&pa&"' style='font-family:Webdings'>9</a><a href='?type=list&classid="& classid & "&page=" & upPage &pa&"' style='font-family:Webdings'>7</a> " & Showstr
End If
'***************结束部分
NextPage = ThisPage + 1
If ThisPage >= PageCountSS Then
Showstr = Showstr & " <span style='font-family:Webdings'>8</span> <span style='font-family:Webdings'>:</span>"
Else
Showstr = Showstr & " <a href='product1.asp?type=list&classid=" & classid & "&page=" & NextPage &pa&" ' style='font-family:Webdings'>8</a><a href='?type=list&classid=" & classid & "&page=" & PageCountSS &pa& "' style='font-family:Webdings'>:</a>"
End If
RsPage.Close
Set RsPage = Nothing
PageStr = Showstr
else
RsPage.Close
Set RsPage = Nothing
end if
End Function
%>