<!--查询及分页设置-->
<%
'查询
dim LogSql,LogRS
set LogRS=server.CreateObject("adodb.recordset")
LogSql="select * from Log order by ID desc"
LogRS.open LogSql,conn,3,2
'分页设置
if LogRS.RecordCount<>0 then
LogRS.PageSize=10 '每页显示数量
CurPage=Request("CurPage") '当前页
if CurPage="" then CurPage=1
LogRS.AbsolutePage=CurPage
end if
%>
<!--输出记录-->
<%do while not LogRS.eof and pagei<LogRS.PageSize%>
<%=LogRS("Title")%><br>
<%
pagei=pagei+1
LogRS.movenext
loop
%>
<!--显示分页-->
<%if CurPage=1 then%>
首页
<%else%>
<a href="?CurPage=1">首页</a>
<%end if%>
<%if CurPage=1 then%>
上一页
<%else%>
<a href="?CurPage=<%=CurPage-1%>">上一页</a>
<%end if%>
<%if LogRS.PageCount<CurPage+1 then%>
下一页
<%else%>
<a href="?CurPage=<%=CurPage+1%>">下一页</a>
<%end if%>
<%if LogRS.PageCount<CurPage+1 then%>
尾页
<%else%>
<a href="?CurPage=<%=LogRS.PageCount%>">尾页</a>
<%end if%> <%=CurPage%>/<%=LogRS.PageCount%>页 <%=LogRS.PageSize%>个/页 共<%=LogRS.RecordCount%>个 转到
<select name="ToPage" id="ToPage" onchange="GoToPage();">
<%for topagei=1 to LogRS.PageCount%>
<option value="<%=topagei%>"<%if CInt(CurPage)=topagei then%> selected="selected"<%end if%>>第<%=topagei%>页</option>
<%next%>
</select>
<script language="javascript">
//跳转页
function GoToPage(){
var getpage
getpage=document.getElementById("ToPage").value
location='?CurPage='+getpage
}
</script>