通用asp数字分页代码

asp数字分页代码  asp分页代码显示数字12345……

<table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
<%
BigClassID=request("BigClassID")
SmallClassID=request("SmallClassID")

connstr = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source="
    connstr = connstr & Server.MapPath("Databases/#cijoy.com.cnhwarker.mdb")
    set conn=Server.CreateObject("AdoDb.Connection")
    conn.Open connstr
    
    If SmallClassID<>"" Then

Set rs1 = Server.CreateObject("ADODB.Recordset")
    sql="select * from SmallClass where SmallClassID="&SmallClassID
    rs1.open sql,conn,1,3
    BigClassName=rs1("enBigClassName")
Smallclassname=rs1("enSmallclassname")
    rs1.close:set rs1=nothing
end if

    If SmallClassID="" Then

Set rs1 = Server.CreateObject("ADODB.Recordset")
    sql="select * from BigClass where BigClassID="&BigClassID
    rs1.open sql,conn,1,3
    BigClassName=rs1("enBigClassName")
    rs1.close:set rs1=nothing
end if
URL= Request.ServerVariables("URL")
If BigClassID ="" and SmallClassID="" Then
            Sql="select * from product order by id desc"
            end if
        If BigClassID <>"" and SmallClassID="" Then
            Sql="Select * From Product Where EnBigClassName ='"& BigClassName &"'  order by id asc"
            end if
        If BigClassID <>"" and SmallClassID<>""  Then
            Sql="Select * From Product Where enBigClassName ='"& BigClassName &"' and ensmallClassName ='"& Smallclassname &"' order by id asc"
        End If
    
set rs=server.createobject("adodb.recordset")
rs.open sql,conn,1,1
if rs.eof and rs.bof then
response.write "<tr><td colspan=9 height=40 colspan=3><center>暂无内容</center></td></tr>"
PageScript="ML"
else
'分页的实现
listnum=12
Rs.pagesize=listnum
pageMax=rs.pagecount
listCount=rs.recordcount

page=Request("page")
if (page-pageMax) > 0 then
page=pageMax
elseif page = "" or page < 1 then
page = 1
end if
rs.absolutepage=page
'编号的实现
j=listCount
j=j-(page-1)*listnum
i=0
nn=request("page")
if nn="" then
n=0
else
nn=nn-1
n=listnum*nn
end if
for i= 1 to (rs.pagesize)/3

%>
<tr>
<%
for j=1 to 3
If Not Rs.Eof Then
%>
<td align="center"  style="padding:10px;"><table width="30%" border="0" cellspacing="0" cellpadding="0">
  <tr>
    <td><table width="180" height="89" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC">
      <tr>
        <td align="center"><a href="ecpzsview.asp?id=<%= Rs("id") %>"><img src='<%=Rs("DefaultPicUrl") %>' border='0'  width='200' height='150' /></a></td>
      </tr>
      <tr></tr>
    </table></td>
  </tr>
  <tr>
    <td align="center" nowrap="nowrap"><%=Rs("entitle") %></td>
  </tr>
</table></td>
<%Else%>
    <%
   End If
   Rs.MoveNext
Next
%>
       </tr>


<%
next
end if
%>
<%filename=URL%>
<tr class="pages" valign="middle">
<td colspan=3 align=right id="bottomPage">
      <% if page>1 then %>
      <a href=<%=filename%>><font face="webdings">9</font></a>
      <a href=<%=filename%>?page=<%=page-1%>><font face="webdings">3</font></a>
      <%else%>
    <a href=<%=filename%>><font face="webdings">9</font></a>
    
      <%end if%>
<%
pageArea=(page\10)*10
for i=pageArea-5 to pageArea+10
if i>0 and i<=pageMax then
if i=cint(page) then
response.write("<font class=bg color='#660000'>【<strong>"&i&"</strong>】</font> ")
else
response.write("【<a href="&filename&"?page="&i&">"&i&"</a>】 ")
end if
end if
next
%>
<% if pageMax-page <> 0 then %>
      <a href=<%=filename%>?page=<%=page+1%>><font face="webdings">4</font></a>
      <a href=<%=filename%>?page=<%=pageMax%>><font face="webdings">:</font></a>
      <%else%>
    
       <a href=<%=filename%>?page=<%=pageMax%>><font face="webdings">:</font></a>
<%end if%>
    </td>
</tr>
</table>


引用通告: 查看所有引用 | 我要引用此文章
Tags: asp数字分页代码 asp分页代码显示数字
收藏到网摘:
评论: 0 | 引用: 0 | 查看次数: -
发表评论
昵 称:
密 码: 游客发言不需要密码.
内 容:
验证码: 验证码
选 项:
虽然发表评论不用注册,但是为了保护您的发言权,建议您注册帐号.