ASP经典FOR循环分页

ASP经典FOR循环


<%

if not rs.eof then
 
      rs.PageSize =30 ‘每页记录条数
    iCount=rs.RecordCount ‘记录总数
    iPageSize=rs.PageSize
       maxpage=rs.PageCount
       page=request(“page”)
   
    if Not IsNumeric(page) or page=”” then
        page=1
    else
        page=cint(page)
    end if
   
    if page<1 then
        page=1
    elseif page>maxpage then
        page=maxpage
    end if
   
    rs.AbsolutePage=Page

if page=maxpage then
   x=iCount-(maxpage-1)*iPageSize
else
   x=iPageSize
end if
pysjzx_i=1

%>
<%

    For i=1 To x%>
            <tr>
             <td height=23>
             &nbsp;&nbsp;<img border=”0″ src=”images/book.gif” >&nbsp;<a title=”<%=rs(“newsname”)%>” target=”_blank” href=”news_list.asp?id=<%=rs(“newsid”)%>”><%if rs(“jingpin”)=1 then%><font color=”ff0000″><%end if%><%=rs(“newsname”)%></font></a>
</td>
            </tr>
            <% if pysjzx_i mod 6=0 then%><tr><td height=1 background=”images/title4.gif”></td>
            </tr>
            <%end if
pysjzx_i=pysjzx_i+1
rs.movenext
   next
%>

滚动至顶部