| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1727 人关注过本帖
标题:麻烦高手帮我看下这段代码哪里错了
只看楼主 加入收藏
凌曦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-7-31
收藏
 问题点数:0 回复次数:11 
麻烦高手帮我看下这段代码哪里错了
<%
rs.PageSize=100
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page  
for j=1 to rs.PageSize
%>
                                    <tr height="25" bgcolor="#ffffff">
                                      <td align=left> <span class="bh">  
                                        <%
   Response.Write ("<a href=view.asp?id="&RS("id")&"  title='" & RS("content") &  " 点击可查看详细信息'  target=_blank>"&RS("title")&"</a>")
%>
                                        <font color="#CCCCCC">[
                                        <% =RS("fbtime") %>
                                        ] </font> </span> </td>
                                    </tr>
                                    <%
rs.movenext
if rs.eof then exit for
next
%>
                                  </table></td>
                              </tr>
                              <tr>
                                <td width="4%" height="1" align="center" background="images/lmdownbg.gif" ><img src="images/newsbg.jpg" width="3" height="1"></td>
                                <td height="1" colspan="2" background="images/lmdownbg.gif"  class=lst01><img src="images/newsbg.jpg" width="3" height="1"></td>
                              </tr>
                              <tr valign="bottom">
                                <td height="50" colspan="4" align="center" > <form method=Post action="xinxiguanli.asp">
                                  <%
                          if rs.recordcount>rs.pagesize then
                          if Page<2 then      
    response.write "首页 上一页&nbsp;"
  else
    response.write "<a href=list.asp?page=1>首页</a>&nbsp;"
    response.write "<a href=list.asp?page=" & Page-1 & ">上一页</a>&nbsp;"
  end if
  if rs.pagecount-page>1 then
    response.write "下一页 尾页"
  else
    response.write "<a href=list.asp?page=" & (page+1) & ">"
    response.write "下一页</a> <a href=list.asp?page="&rs.pagecount&">尾页</a>"
  end if
   response.write "&nbsp;页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
    response.write "&nbsp;共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条 <b>"&rs.pagesize&"</b>条/页"
   response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
   response.write " <input class=input type='submit'  value=' Go '  name='cndok'></span></p>"     
end if
%>
点下一页的时候显示没有信息!谢谢
搜索更多相关主题的帖子: 代码 麻烦 page AbsolutePage 
2008-07-31 11:04
凌曦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-7-31
收藏
得分:0 
上一段是 <%

page=clng(request("page"))        
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select *  from shangji where leixing='"& request.QueryString("type") &"' order by id desc "
rs.Open sql,oConn,1,3
if rs.eof and rs.bof then
response.Write("你没有发布信息")
else
%>
                            </span>
                            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                              <tr>
                                <td height="20" colspan="3" align="center" > <br>
                                  <table border="1" cellspacing="0" cellpadding="0" width="100%" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
                                    <tr bgcolor="#eeeeee">
                                      <td height=26 align=center> <div align="left"><b>信息标题</b></div></td>
                                    </tr>

[[it] 本帖最后由 凌曦 于 2008-7-31 11:40 编辑 [/it]]
2008-07-31 11:39
octillion
Rank: 1
等 级:新手上路
帖 子:195
专家分:0
注 册:2008-7-24
收藏
得分:0 
你的提问真的不能简化一下代码吗?
越长的代码别人越没耐心看
2008-07-31 12:18
jamesxiaoyao
Rank: 1
等 级:新手上路
威 望:2
帖 子:173
专家分:0
注 册:2007-5-21
收藏
得分:0 
你一共有几条信息哦,一页显示100条 ?
2008-07-31 13:29
凌曦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-7-31
收藏
得分:0 
一页100条,点下一页就出问题了
response.write "<a href=list.asp?page=" & (page+1) & ">"
    response.write "下一页</a> (有朋友说要在这里加个参数type)<a href=list.asp?page="&rs.pagecount&">尾页</a>"
怎么加啊?
2008-07-31 15:02
tianyu123
Rank: 1
等 级:新手上路
威 望:2
帖 子:576
专家分:0
注 册:2007-8-26
收藏
得分:0 
每个连接都得加上
response.write "<a href=list.asp?type="& request.QueryString("type") &"&page=" & (page+1) & ">"

改变一切,须从改变观念开始!
2008-07-31 17:08
tianyu123
Rank: 1
等 级:新手上路
威 望:2
帖 子:576
专家分:0
注 册:2007-8-26
收藏
得分:0 
每个连接都得加上
response.write "<a href=list.asp?type="& request.QueryString("type") &"&page=" & (page+1) & ">"

改变一切,须从改变观念开始!
2008-07-31 17:08
凌曦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-7-31
收藏
得分:0 
response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
   response.write " <input class=input type='submit'  value=' Go '  name='cndok'></span></p>"     
end if
%>
这里应该怎么加呢?
2008-08-01 12:53
tianyu123
Rank: 1
等 级:新手上路
威 望:2
帖 子:576
专家分:0
注 册:2007-8-26
收藏
得分:0 
先写个javascript函数
function url(act)
{
var page=document.getElementById("page").value;
location.href="list.asp?type="+act+"&page="+page;
}

response.write " 转到:<input type='text' id=page name='page' size=4 maxlength=10 class=input value="&page&">"
response.write " <input class=input type='button'  value=' Go '  name='cndok' onclick=url("& request.QueryString("type") &");></span></p>"

改变一切,须从改变观念开始!
2008-08-01 19:53
凌曦
Rank: 1
等 级:新手上路
帖 子:9
专家分:0
注 册:2008-7-31
收藏
得分:0 
输入跳转还是没有用,我把整页发上来你帮我看下怎么改,谢谢了
<!--#include file="../setup.asp"-->
<!--#include file="conn.asp"-->
<html>
<head>
<title><%=WebSite_Title%></title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<STYLE type=text/css>
                BODY {
    MARGIN: 0px
}
BODY {
    FONT-SIZE: 9pt;
}
TABLE {
    FONT-SIZE: 9pt
}
.top {
    FONT-SIZE: 9pt; COLOR: #ffffff; TEXT-DECORATION: none
}
.text {
    FONT-SIZE: 9pt; LINE-HEIGHT: 1.6; TEXT-DECORATION: none
}
.text2 {
    FONT-SIZE: 10.5pt; LINE-HEIGHT: 1.7; TEXT-DECORATION: none
}
A {
    FONT-SIZE: 9pt; COLOR: #333333; LINE-HEIGHT: 1.6; TEXT-DECORATION: none
}
A:hover {
    FONT-SIZE: 9pt; COLOR: #cc0000; LINE-HEIGHT: 1.6; TEXT-DECORATION: underline
}
.black A {
    FONT-SIZE: 9pt; COLOR: #333333; LINE-HEIGHT: 1.6; TEXT-DECORATION: underline
}
.black A:hover {
    FONT-SIZE: 9pt; COLOR: #cc0000; LINE-HEIGHT: 1.6; TEXT-DECORATION: none
}
.link2 A {
    FONT-SIZE: 9pt; COLOR: #cc3366; LINE-HEIGHT: 1.6; TEXT-DECORATION: none
}
.link2 A:hover {
    FONT-SIZE: 9pt; COLOR: #333333; LINE-HEIGHT: 1.6; TEXT-DECORATION: underline
}
                .style1 {color: #FF0000}
.style2 {color: #0000FF}
.style4 {color: #FF0000; font-weight: bold; }
</STYLE>
<script language=javascript>
    function one(){
      var url="e_click.asp";
      document.form.action=url;
    }
    function search(){
      var url="search.asp";
      document.form.action=url;
    }
</script>
</head>
<body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0">
<!--#include file="top.asp" -->
<TABLE cellSpacing=0 cellPadding=0 width=952 align=center
background="../image/bj114bg.gif" border=0>
  <TBODY>
    <TR>
      <TD width=16> </TD>
      <TD width="920">
        <table width="920" height="100%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
          <tr>
            <td width="684" height="100%" valign="top">
              <table width="670" border="0" cellpadding="1" cellspacing="1" bgcolor="#99CC00">
                <tr>
                  <td bgcolor="#FFFFFF"><table width="100%" border="0" align="center" cellpadding="5" cellspacing="0">
                      <tr>
                        <td height="30" background="../image/hytop.gif" bgcolor="#000000">
                          <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                              <td> <div align="right">出售</div></td>
                            </tr>
                          </table></td>
                      </tr>
                      <tr> </tr>
                    </table></td>
                </tr>
              </table>
              <table width="670" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="10"><TABLE width="100%" height="400" border=0
                              align=center cellPadding=2 cellSpacing=2>
                      <TBODY>
                        <TR>
                          <TD valign="top">
<LINK href="images/kd.css" type=text/css
                                rel=stylesheet>
                            <span class="bh"> </span> <span class="bh">
                            <%

page=clng(request("page"))        
Set rs=Server.CreateObject("ADODB.RecordSet")
sql="select *  from shangji where leixing='"& request.QueryString("type") &"' order by id desc "
rs.Open sql,oConn,1,3
if rs.eof and rs.bof then
response.Write("你没有发布信息")
else
%>
                            </span>
                            <table width="100%" border="0" align="center" cellpadding="0" cellspacing="0">
                              <tr>
                                <td height="20" colspan="3" align="center" > <br>
                                  <table border="1" cellspacing="0" cellpadding="0" width="100%" bordercolorlight="#C0C0C0" bordercolordark="#FFFFFF">
                                    <tr bgcolor="#eeeeee">
                                      <td height=26 align=center> <div align="left"><b>信息标题</b></div></td>
                                    </tr>
                                    <%
rs.PageSize=100
if page=0 then page=1
pages=rs.pagecount
if page > pages then page=pages
rs.AbsolutePage=page  
for j=1 to rs.PageSize
%>
                                    <tr height="25" bgcolor="#ffffff">
                                      <td align=left> <span class="bh">  
                                        <%
   Response.Write ("<a href=view.asp?id="&RS("id")&"  title='" & RS("content") &  " 点击可查看详细信息'  target=_blank>"&RS("title")&"</a>")
%>
                                        <font color="#CCCCCC">[
                                        <% =RS("fbtime") %>
                                        ] </font> </span> </td>
                                    </tr>
                                    <%
rs.movenext
if rs.eof then exit for
next
%>
                                  </table></td>
                              </tr>
                              <tr>
                                <td width="4%" height="1" align="center" background="images/lmdownbg.gif" ><img src="images/newsbg.jpg" width="3" height="1"></td>
                                <td height="1" colspan="2" background="images/lmdownbg.gif"  class=lst01><img src="images/newsbg.jpg" width="3" height="1"></td>
                              </tr>
                              <tr valign="bottom">
                                <td height="50" colspan="4" align="center" > <form method=Post action="list.asp">
                                    <%
                          if rs.recordcount>rs.pagesize then
                          if Page<2 then      
    response.write "首页 上一页&nbsp;"
  else
    response.write "<a href=list.asp?type="& request.QueryString("type") &"&page=1>首页</a>&nbsp;"
    response.write "<a href=list.asp?type="& request.QueryString("type") &"&page=" & Page-1 & ">上一页</a>&nbsp;"
  end if
  if rs.pagecount-page<1 then
    response.write "下一页 尾页"
  else
    response.write "<a href=list.asp?type="& request.QueryString("type") &"&page=" & (page+1) & ">"
    response.write "下一页</a> <a href=list.asp?type="& request.QueryString("type") &"&page="&rs.pagecount&">尾页</a>"
  end if
   response.write "&nbsp;页次:<strong><font color=red>"&Page&"</font>/"&rs.pagecount&"</strong>页 "
    response.write "&nbsp;共<b><font color='#FF0000'>"&rs.recordcount&"</font></b>条 <b>"&rs.pagesize&"</b>条/页"
   response.write " 转到:<input type='text' name='page' size=4 maxlength=10 class=input value="&page&">"
   response.write " <input class=input type='submit' &"& value=' Go '  name='cndok'></span></p>"     
end if
%>
                                  </form></td>
                              </tr>
                            </table>
                            <%
end if
rs.close
set rs=nothing
%>
                            <span class="bh"> </span> <LINK
                                href="images/kd.css" type=text/css
                                rel=stylesheet> <LINK
                                href="images/kd.css" type=text/css
                                rel=stylesheet> <LINK
                                href="images/kd.css" type=text/css
                                rel=stylesheet> <LINK
                                href="images/kd.css" type=text/css
                                rel=stylesheet> </TD>
                        </TR>
                      </TBODY>
                    </TABLE></td>
                </tr>
              </table>
            </td>
            <td width="236" valign="top" background="../images/xinjiarubg.gif" style="BORDER-BOTTOM: #DFDEDC 1px solid"><table width="190%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                <tr>
                  <td height="5"></td>
                </tr>
              </table>
              <table width="236" border="0" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="236" height="94" background="../images/diqufnlei.gif">
                    <table width="224" height="25" border="0" align="center" cellpadding="0" cellspacing="0">
                      <tr>
                        <td width="224" height="25"> <div align="center"><B><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 14px"><font color="#FF0000">按
                            地 区 分 类</font></SPAN></B></div></td>
                      </tr>
                    </table>
                    <table width="224" border="0" align="center" cellpadding="5" cellspacing="0">
                      <tr>
                        <td width="214">
                          <%
set rs=server.createobject("adodb.recordset")
rs.open "select * from area where area_id=0",oconn,1,1
if rs.eof and rs.bof then
'
else
do while not rs.eof
%>
                          <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                              <td width="25%">
                                <%if not rs.eof then%>
                                <a href="../area.asp?area_id=<%=rs("id")%>"><%=rs("area")%></a>
                                <%
rs.movenext
end if
%>
                              </td>
                              <td width="25%">
                                <%if not rs.eof then%>
                                <a href="../area.asp?area_id=<%=rs("id")%>"><%=rs("area")%></a>
                                <%
rs.movenext
end if
%>
                              </td>
                              <td width="25%">
                                <%if not rs.eof then%>
                                <a href="../area.asp?area_id=<%=rs("id")%>"><%=rs("area")%></a>
                                <%
rs.movenext
end if
%>
                              </td>
                              <td width="25%">
                                <%if not rs.eof then%>
                                <a href="../area.asp?area_id=<%=rs("id")%>"><%=rs("area")%></a>
                                <%
rs.movenext
end if
%>
                              </td>
                            </tr>
                            <tr>
                              <td height="5" colspan="4"></td>
                            </tr>
                          </table>
                          <%
loop
end if
rs.close
set rs=nothing
%>
                        </td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              <table width="190%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
                <tr>
                  <td height="5"></td>
                </tr>
              </table>
              <table width="236" height="14" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td width="236" height="38" background="../images/xinjiaru.gif">
                    <div align="center"><B><SPAN style="FONT-WEIGHT: bold; FONT-SIZE: 14px"><font color="#FFFFFF">最新加入企业</font></SPAN></B></div></td>
                </tr>
              </table>
              <%
set rs=server.createobject("adodb.recordset")
rs.open "select top 5 id,username,area_one,area_two,company,verify from company where verify=0 order by id desc",oconn,1,1
if rs.eof and rs.bof then
'
else
do while not rs.eof
%>
              <table width="225" border="0" align="center" cellpadding="5" cellspacing="1" bgcolor="#CCCCCC">
                <tr>
                  <td width="208" bgcolor="#FFFFFF"> <table width="100%" border="0" cellpadding="0" cellspacing="0">
                      <tr>
                        <td height="20"><a href="../company.asp?id=<%=rs("id")%>"  target="_blank"><strong><%=left(rs("company"),15)%></strong></a></td>
                      </tr>
                      <tr>
                        <td height="20">地区分类:<%=rs("area_one")%><span>·</span><%=rs("area_two")%></td>
                      </tr>
                    </table></td>
                </tr>
              </table>
              <table width="190" border="0" align="center" cellpadding="0" cellspacing="0">
                <tr>
                  <td height="10"></td>
                </tr>
              </table>
              <%
rs.movenext
loop
end if
rs.close
set rs=nothing
conn.close
set conn=nothing
%>
            </td>
          </tr>
        </table> </TD>
      <TD width=15> </TD>
    </TR>
  </TBODY>
</TABLE>
<!--#include file="bottom.asp" -->
</body>
</html>
2008-08-02 10:10
快速回复:麻烦高手帮我看下这段代码哪里错了
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.027311 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved