天下3永久时装图片:帮我看一下这段代码怎么翻页显示的时候不正确

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/12 19:40:07
以下代码是显示产品的,一页一共显示9个产品可是如果翻第二页的时候怎么显示的所有的产品排列,翻第三页也是,请高手赐教!
//------过程名:
sub ShowArticle(TitleLen)
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
sqlArticle="select top " & MaxPerPage
else
sqlArticle="select "
end if
sqlArticle=sqlArticle & " ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
if BigClassName<>"" then
sqlArticle=sqlArticle & " and BigClassName='" & BigClassName & "' "
if SmallClassName<>"" then
sqlArticle=sqlArticle & " and SmallClassName='" & SmallClassName & "' "
end if
else
if SpecialName<>"" then
sqlArticle=sqlArticle & " and SpecialName='" & SpecialName & "' "
end if
end if
sqlArticle=sqlArticle & " order by articleid desc"
Set rsArticle= Server.CreateObject("ADODB.Recordset")
rsArticle.open sqlArticle,conn,1,1
if rsArticle.bof and rsArticle.eof then
response.Write("<br><li>No product</li>")
else
if currentPage=1 then
call ArticleContent(TitleLen)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsArticle.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsArticle.bookmark
call ArticleContent(TitleLen)
else
currentPage=1
call ArticleContent(TitleLen)
end if
end if
end if
rsArticle.close
set rsArticle=nothing
end sub
'---------显示产品的代码---
sub ArticleContent(intTitleLen)
dim i,strTemp
strTemp=""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
do while not rsArticle.eof
strTemp=strTemp+"<tr>"
for i=1 to 3
if rsArticle.bof or rsArticle.eof then exit for
strTemp= strTemp & "<td width=33% align=center>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=150 height=120>"
strTemp= strTemp & "</a><br>"
strTemp= strTemp & "Item name:"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
rsArticle.movenext
next
strTemp= strTemp & "</tr>"
loop strTemp= strTemp & "</table>"
response.write strTemp
end sub
我要改的效果是每页都只显示9个产品,现在的错误是第1页是显示9个产品,可翻第二页或后面的页都是把所有的产品都显示出来了,怎么解决这个问题?
////////////////////////////////////////////////////
我还没有解决呀,你提醒一下错误在哪里呀?

已经解决了吧?
呵呵,加油!~