ITPub博客

首页 > Linux操作系统 > Linux操作系统 > asp图片排列及分页

asp图片排列及分页

原创 Linux操作系统 作者:mzr_cj 时间:2009-03-11 16:47:48 0 删除 编辑
      做过两个展示商品的网站,于是用到下面的代码:
 

              <%
set rs=server.createobject("adodb.recordset")
sqls="select * from products order by id asc"
rs.open sqls,conn,1,1
IF not rs.eof Then
proCount=rs.recordcount
rs.PageSize=12       '定义显示数目
   if not IsEmpty(Request("ToPage")) then
        ToPage=CInt(Request("ToPage"))
     if ToPage>rs.PageCount then
      rs.AbsolutePage=rs.PageCount
      intCurPage=rs.PageCount
     elseif ToPage<=0 then
      rs.AbsolutePage=1
      intCurPage=1
     else
      rs.AbsolutePage=ToPage
      intCurPage=ToPage
     end if
    else
           rs.AbsolutePage=1
      intCurPage=1
    end if
intCurPage=CInt(intCurPage)
k=1
do while Not rs.eof and k<4 '控制显示行数
%>
             
                <%
for n=1 to 4
%>
           
                <%
rs.movenext
if rs.eof then exit for
if rs.eof then exit do
Next
%>
             
              <%
k=k+1
Loop
%>
         

                   
                     
                   
               

                       
                         
                           
                         
                         
                           
                         
                       

                               
                                 
                                 
                           

                                     
                                       
                                     
                                 

                                           
                                             
                                           
                                       

                                               " target=_blank>
                                               width="120" height="120" border="0" />

                             
                               
                                 
                               
                             

                                  <% if len(rs("title"))<=8 then
                                     Response.write rs("title")
                                     else
                                     response.write left(rs("title"),8)&"..."
                                     end if
                                     %>
                                    

      

             

       
                 
                   
                     
                       
                     
                 

                           
总共:<%=rs.PageCount%>页, <%=proCount%>个产品, 当前页: <%=intCurPage%>
                                  <% if intCurPage<>1 then
    %>
                                  首页|上一页|
                                  <% end if
if intCurPage<>rs.PageCount then %>
                                  下一页| 最后一页
                                  <% end if%>
                           

                         
                           

                              <%end if%>
                         

             
           

来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/21022866/viewspace-566841/,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2009-03-05

  • 博文量
    17
  • 访问量
    73549