'定义分页显示的变量
dim totalcs,Currentpage,totalpages,i
neirong=trim(request("neirong"))
fangshi=request("fangshi")
rs.open sql,conn,1,1
'统计记录数
totalcs=rs.recordcount
%>
<script language="JavaScript">
alert("检索不到,请确定重新搜索!");
location.href = "right.asp";
</script>
<%
else
rs.movefirst
if trim(request("page"))<>"" then
currentpage=clng(request("page"))
if currentpage>rs.pagecount then
currentpage=rs.pagecount
end if
else
currentpage=1
end if
if currentpage<>1 then
if (currentpage-1)*20<totalcs then
rs.move(currentpage-1)*20
dim bookmark
bookmark=rs.bookmark
end if
end if
if (totalcs mod 10)=0 then
totalpages=totalcs\10
else
totalpages=totalcs\10+1
end if
i=0
%>
<%
do while not rs.eof and i<10
%>
............................................................
<%
i=i+1
rs.movenext
loop
end if
%>
<img height=14 width=14 align=absMiddle src="../南京便民房屋/images/cha.gif"> 共搜索到<font color="red">[<%=totalcs%>]</font>条记录 分<font color="red">[<%=totalpages%>]</font>页
<IMG height=11 src="../南京便民房屋/images/lt.gif" width=11 align=absMiddle>
<%
if CurrentPage<2 then
response.write "<font color='999966'>首页 上一页</font> "
else
response.write "<a href=SearchResult.asp?page=1>首页</a> "
response.write "<a href=SearchResult.asp?page="&CurrentPage-1&">上一页</a> "
end if
if totalpages-currentpage<1 then
response.write "<font color='999966'>下一页 尾页</font>"
else
response.write "<a href=SearchResult.asp?page="&CurrentPage+1&""
response.write ">下一页</a> <a href=SearchResult.asp?page="&totalpages&">尾页</a>"
end if
%>
[此贴子已经被作者于2006-7-11 9:10:26编辑过]