ASP分页

<TABLE cellSpacing=0 cellPadding=0 width="96%" border=0>
              <TBODY>
              <TR>
                <TD align=left>
                  <UL>
      <%
  set rs=server.CreateObject("adodb.recordset")
        sql = "select  * from Ejz_User order by P_AddDate DESC"
        rs.Open sql,conn,1,1
  If rs.eof or rs.bof Then
      %>
       <LI class=txt> 没有找到您要查找的内容......
      <%
       else
       If cint(request("page"))<1 or request("page")="" Then
      ipage=1
     Else
      ipage=cint(request("page"))
     End if
      rs.pagesize=3
      pagecount=rs.pagecount
      rs.absolutepage=ipage
      While not rs.eof and i<rs.pagesize
      P_UserId   = rs("P_UserId")
      P_Hync  = rs("P_Hync")
      P_JuZhuDi_xian  = rs("P_JuZhuDi_xian")
      P_Hyzk  =rs("P_Hyzk")
      P_AddDate  =rs("P_AddDate")
          %>
                    <LI class=txt>
                    <a href="User/Xxxx/Show_1.Asp?P_UserId=<%=rs("P_UserId")%>" target="_blank" title="查看详细信息">
<span style="float:left;width:150px;"><%=Left(rs("P_Hync"),6)%>&nbsp;,<%=Age(rs("P_BirthdayTime"))%>&nbsp;,<%=rs("P_JuZhuDi_xian")%></span><span style="float:right; width:40px"><%=FormatDT(rs("P_AddDate"),7)%></span>
</a>
       <%   
                i=i+1
                   rs.movenext
                wend
        end if
          %>
                    </LI></UL></TD></TR>
              <TR>
                <TD align=right>
                 <TABLE cellSpacing=0 cellPadding=0 width="98%" align=center border=0>
                            <TBODY>
                              <TR>
                                <TD width=512  height=1></TD>
                              </TR>
                           
                              <TR>
                                <TD width="80%" align="right" class="Aqss-honglink STYLE1">
        <div align="right">
                                <%if ipage=1 then%>
                                  <font color="#999999">【首页】</font>
                                  <%else%>
                                <A href="?page=1">【首页】</A>
                                <%end if%>
                                <%if ipage=0 or ipage=1 then%>
                                  <font color="#999999">【上一页】</font>
                                  <%else%>
                                  <A href="?page=<%=ipage-1%>">【上一页】</A>
                                <%end if%>
                                <%if ipage=rs.pagecount then%>
                                  <font color="#999999">【下一页】</font>
                                  <%else%>
                                  <A href="?page=<%=ipage+1%>">【下一页】</A>
                                <%end if%>
                                <%if ipage=pagecount then%>
                                  <font color="#999999">【尾页】</font>
                                  <%else%>
                                  <A href="?page=<%=pagecount%>">【尾页】</A>
                                <%end if%>
                                  </div></TD>
                              </TR>
                          </TABLE>
         <%
        rs.close
        set rs=nothing
        %>
     </TD></TR></TBODY></TABLE>

 

posted @ 2012-11-05 09:55  Liu66~  阅读(172)  评论(0编辑  收藏  举报