注册 登录
编程论坛 ASP技术论坛

为什么我这个没循环

a768841969 发布于 2011-06-18 15:14, 348 次点击
<!--#include file="conn.asp"-->
<style type="text/css">
<!--
.STYLE2 {font-size: 14px}
.xgxw{ font-size:14px;}
.page{
    text-align:center;
    padding:10px 0px;
    font-size:12px;
}

.page .pageon{
    padding:0px 10px;
    font-weight:bold;
}

.page .pagelink a{
    background:#F2F2F2;
    border:#ACACAC 1px solid;
    padding:3px 6px;
    color:#7C7C7C;
    margin:0px -1px;
    display:inline;
blr:expression(this.onFocus=this.blur());
outline:0;
}

.page .pagelink a.p1{
    _padding:3px 6px 1px 6px;
}

.page .pagelink a:hover{
    background:#7BC0E7;
    padding:3px 6px;
    border:#456B9A 1px solid;
    color:#010000;
    text-decoration:none;
}
-->
</style>
<%
set rs=server.CreateObject("adodb.recordset")
rs.open "select * from news_aboutus where articleid=2134",conn,3,2
if not rs.eof then
   content=rs("content")
   end if
   rs.close
    s="<div style=""page-break-after: always""><span style=""display: none"">&nbsp;</span></div>"
     content=replace(content,s,"[NextPage]")
       ContentStr=split(content,"[NextPage]")'根据分页标签,将内容保存数组
       if request("page")="" then
               pagenum=0
            else
               if cint(request("page"))>cint(ubound(ContentStr)) then
               pagenum=ubound(ContentStr)
               else      
               pagenum=request("page")
               end if
        end if                    
        response.write ContentStr(pagenum)'取出当前页的内容                        
     For i = LBound(ContentStr) To UBound(ContentStr)
     'response.write "<a href='test1.asp?page="&i&"'>["&i+1&"]</a>"
     %>
   
    <div class="page"><span class='<% if pagenum=i then response.Write("pageon") else response.Write("pagelink") end if%>'><a href='test1.asp?page=<%=i%>'><%=i+1%></a></span>&nbsp;</div>
    <%
        Next        
%>

我弄了一个按分页符分页的代码,但在输出下面的数字时没有实现循环。我进入页面的时候效果实现了 但是点第二页的时候就没反应。
只有本站会员才能查看附件,请 登录
这是刚进去的时候     
只有本站会员才能查看附件,请 登录
这是点第二页的

[ 本帖最后由 a768841969 于 2011-6-18 15:17 编辑 ]
0 回复
1