| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 714 人关注过本帖
标题:分页成功但是点击下页后还是原来的页面,郁闷的很
只看楼主 加入收藏
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
结帖率:92.31%
收藏
 问题点数:0 回复次数:4 
分页成功但是点击下页后还是原来的页面,郁闷的很
<%
                                            set rsb=server.CreateObject("adodb.recordset")
                                            sqlb="select * from products   "
                                            rsb.open sqlb ,conn,1,1
                                            rsb.pagesize=5
                                            curpage=Request.QueryString("curpage")
if rsb.bof and rsb.eof then
response.Write"暂无记录!"
response.End()
end if
if curpage="" then curpage=1
for i= 1 to rsb.pagesize
if rsb.eof then
exit for
end if
                                            %>
                                            
                                            <table width="85%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
                                              <tr>
                                                <td width="48%" rowspan="3" bgcolor="#FFFFFF"><img src="<%=rsb("url")%>" width="200" height="100"></td>
                                                <td width="18%" height="18" bgcolor="#FFFFFF" class="style4 style5">公司名称:</td>
                                                <td width="34%" align="center" bgcolor="#FFFFFF" class="style4"><%=rsb("webname")%></td>
                                              </tr>
                                              <tr>
                                                <td height="18" bgcolor="#FFFFFF" class="style6">公司网址:</td>
                                                <td height="18" align="center" bgcolor="#FFFFFF" class="style4"><%=rsb("web")%></td>
                                              </tr>
                                              <tr>
                                                <td height="53" colspan="2" bgcolor="#FFFFFF"><%=rsb("contnet")%></td>
                                              </tr>
                                            </table>
                                            
                                            <table width="11" border="0" cellspacing="0" cellpadding="0">
                                              <tr>
                                                <td>&nbsp;</td>
                                              </tr>
                                            </table>
                                            <%
rsb.movenext
next
%>
<%if curpage=1 then%>
首页
<%else%>
<a href="?curpage=1">首页</a>
<%end if%>

<%if curpage=1 then%>
上一页
<%else%>
<a href="?curpage=<%=curpage-1%>">上一页</a>
<%end if%>

<%if rsb.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?curpage=<%=curpage+1%>">下一页</a>
<%end if%>

<%if rsb.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?curpage=<%=rsb.pagecount%>">尾页</a>
<%end if%>
共<%=rsb.pagecount%>页 &nbsp;&nbsp;共有<%=rsb.recordcount%>条新闻  当前第<%=curpage%>页</td>
搜索更多相关主题的帖子: 页面 
2008-07-28 17:42
tianyu123
Rank: 1
等 级:新手上路
威 望:2
帖 子:576
专家分:0
注 册:2007-8-26
收藏
得分:0 
分页代码错误!建议研究一下成功的分页代码看一下!

改变一切,须从改变观念开始!
2008-07-28 17:54
kingbess
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2008-7-28
收藏
得分:0 
分页要设置三个属性.
2008-07-28 17:58
tianyu123
Rank: 1
等 级:新手上路
威 望:2
帖 子:576
专家分:0
注 册:2007-8-26
收藏
得分:0 
加入蓝色部分
<%
                                            set rsb=server.CreateObject("adodb.recordset")
                                            sqlb="select * from products   "
                                            rsb.open sqlb ,conn,1,1
                                            rsb.pagesize=5
                                            curpage=Request.QueryString("curpage")
if rsb.bof and rsb.eof then
response.Write"暂无记录!"
response.End()
end if
if curpage="" then curpage=1
rsb.absolutepage=curpage '将当前页赋值给逻辑页
for i= 1 to rsb.pagesize
if rsb.eof then
exit for
end if
                                            %>
                                            
                                            <table width="85%" border="0" cellpadding="1" cellspacing="1" bgcolor="#CCCCCC">
                                              <tr>
                                                <td width="48%" rowspan="3" bgcolor="#FFFFFF"><img src="<%=rsb("url")%>" width="200" height="100"></td>
                                                <td width="18%" height="18" bgcolor="#FFFFFF" class="style4 style5">公司名称:</td>
                                                <td width="34%" align="center" bgcolor="#FFFFFF" class="style4"><%=rsb("webname")%></td>
                                              </tr>
                                              <tr>
                                                <td height="18" bgcolor="#FFFFFF" class="style6">公司网址:</td>
                                                <td height="18" align="center" bgcolor="#FFFFFF" class="style4"><%=rsb("web")%></td>
                                              </tr>
                                              <tr>
                                                <td height="53" colspan="2" bgcolor="#FFFFFF"><%=rsb("contnet")%></td>
                                              </tr>
                                            </table>
                                            
                                            <table width="11" border="0" cellspacing="0" cellpadding="0">
                                              <tr>
                                                <td> </td>
                                              </tr>
                                            </table>
                                            <%
rsb.movenext
next
%>
<%if curpage=1 then%>
首页
<%else%>
<a href="?curpage=1">首页</a>
<%end if%>

<%if curpage=1 then%>
上一页
<%else%>
<a href="?curpage=<%=curpage-1%>">上一页</a>
<%end if%>

<%if rsb.pagecount<curpage+1 then%>
下一页
<%else%>
<a href="?curpage=<%=curpage+1%>">下一页</a>
<%end if%>

<%if rsb.pagecount<curpage+1 then%>
尾页
<%else%>
<a href="?curpage=<%=rsb.pagecount%>">尾页</a>
<%end if%>
共<%=rsb.pagecount%>页   共有<%=rsb.recordcount%>条新闻  当前第<%=curpage%>页</td>

改变一切,须从改变观念开始!
2008-07-28 18:02
kgdipbyve
Rank: 2
等 级:论坛游民
帖 子:346
专家分:35
注 册:2008-5-4
收藏
得分:0 
不意思,昨天大概放差地方了...今天试了下可以用了

[[it] 本帖最后由 kgdipbyve 于 2008-7-29 08:43 编辑 [/it]]
2008-07-28 18:05
快速回复:分页成功但是点击下页后还是原来的页面,郁闷的很
数据加载中...
 
   



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

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