+ -
当前位置:首页 → 问答吧 → 请问为什么asp没有上一页跟下一页

请问为什么asp没有上一页跟下一页

时间:2011-10-31

来源:互联网

SQL code
<%
        function Text2Html( text )
        text = replace(text,">","&gt;")
        text = replace(text,"<","&lt;")
        text = replace(text,chr(32),"&nbsp;")
        text = replace(text,chr(13),"")
        text = replace(text,chr(10),"<br>")
        Text2Html = text
    end function 
    on Error Resume Next

   '每页显示笔数
    pagggeCount = 10

    paggge = request("paggge")
    
    if paggge = "" then
        paggge = 1
        
    end if
    '資料庫連結
    SQLSS = 'SQL指令
    set rs = Server.CreateObject("ADODB.Recordset")
    rs.open SQLSS,conn,3,3,1
    
    if rs.recordcount <> 0 then
        rs.pagggeSize = pagggeCount
        rs.Absolutepaggge = paggge

        for i = 1 to rs.pagggeSize
            if rs.eof then
                exit for
            end if
    
          
%>
    <table width="600" height="400">
    <tbody>
        <tr>
            <td width="30" ><span class="style6">aaa</span></td>
            <td width="50" ><%=rs("aa")%></td>
            <td width="60" ><span class="style6">bbb</span></td>
            <td width="30" ><%=rs("bb")%></td>
        </tr>
        <tr>
            <td width="30" ><span class="style6">ccc</span></td>
            <td width="50" ><%=rs("cc")%></td>
            <td width="60" ><span class="style6">ddd</span></td>
            <td width="30" "><%=rs("dd")%></td>
        </tr>
    </tbody>
    </table>
<%
            rs.MoveNext
            next
%>
<!-- div pagination begin -->
<div class="pagination">
<%
        for i = 1 to rs.pagggeCount
            if cint(i) = cint(paggge) then
                response.write "<span class ='current'>" & i & "</span>"
            else
                response.write "<a href='#' onClick='tolinks(" & i & ");'> " & i & " </a>"
            end if
        next
%>
</div>
<!-- div pagination end-->



我希望呈现的样子是↓
< 1 2 3 4 5 6 7 8 9 10 >
按下">"时出现↓
< 11 12 13 14 15 16 17 18 19 20 >

可为什么他现在变成
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
都在同一页呢???

作者: kiken10   发布时间: 2011-10-31

<%
  for i = 1 to rs.pagggeCount
  if cint(i) = cint(paggge) then
  response.write "<span class ='current'>" & i & "</span>"
  else
  response.write "<a href='#' onClick='tolinks(" & i & ");'> " & i & " </a>"
  end if
  next
%>

你这段要进行判断额

当前选择页大于10的时候

显示当前页码 >10<=20的页码

作者: enjoy_gw   发布时间: 2011-10-31

帮顶。。。。。

作者: From_TaiWan   发布时间: 2011-10-31

可是我在
<%
  for i = 1 to rs.pagggeCount
  if cint(i) = cint(paggge) then
  response.write "<span class ='current'>" & i & "</span>"
  else
  response.write "<a href='#' onClick='tolinks(" & i & ");'> " & i & " </a>"
  end if
  next
%>

已经有说只有1~10了>"<
难道这样还不行吗?

作者: kiken10   发布时间: 2011-10-31