大家帮忙修改一下这个分页类的代码(搜索时第一页正常,第二页开始就显示所有数据了)
这些代码是别人写的,后来我拿来用的时候加上了搜索功能,调用时才发现搜索时第一页正常,第二页开始就显示所有数据了(他原先没考虑要搜索的情况),我知道是参数没传递过去,不过不知如何修改了,望各位帮忙,解决后立即给分。
相关代码:
分页功能做成了一个类,类中关键代码:
sub guide(first_image,prev_image,next_image,last_image)
if nowpage<>1 then '首页 Response.Write "<a href=?nowpage=1"&postall&">"&first_image&"</a> "
else
Response.Write first_image&" "
end if
if nowpage<>1 then ’上页
response.write "<a href=?nowpage="&prev_page&postall&">"&prev_image&"</a> "
else
Response.Write prev_image&" "
end if
if (nowpage<total_page) then ‘下页 Response.Write "<a href=?nowpage="&next_page&postall&">"&next_image&"</a> "
else
Response.Write next_image&" "
end if
if nowpage<total_page then ’尾页
Response.Write "<a href=?nowpage="&last_page&postall&">"&last_image&"</a> "
else
Response.Write last_image&" "
end if
end sub
调用代码:
page1.guide "首页","上页","下页","尾页"
page1为从类中派生的一个对象。
好像关键是怎么样在把recordset对象传给类,类中好像默认是重新初始化类,然后检索所有数据?
另:我知道如何重新写一个分页程序,不过想把这个类完善一下以后方便用,请帮忙。