| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 383 人关注过本帖
标题:ASP分页问题
只看楼主 加入收藏
icebo
Rank: 1
等 级:新手上路
帖 子:62
专家分:0
注 册:2006-6-3
收藏
 问题点数:0 回复次数:0 
ASP分页问题

做了一个ASP的页子,分页显示的时候点下一页总是只能显示第二页的内容:
问题页面见:
http://www.icebo.com/mm/index.asp(是一个图片欣赏页面)
问题页只要代码:
<%
sql="select * from bobo order by t desc"
set rs= Server.CreateObject("ADODB.RecordSet")
rs.Open sql, Conn, 1, 2

page=Request("page")
if page=0 then
page=1
end if
RecordCount = 0
do while not rs.Eof
RecordCount = RecordCount +1
rs.MoveNext
loop
if not RecordCount=0 then
rs.MoveFirst
end if
pageCount=RecordCount/25
pageCount=int(pageCount)
if (RecordCount mod 25)>0 then
PageCount=PageCount +1
end if
if pagecount=0 then pagecount=1
if page>pagecount then page=pagecount

do while pos<(page-1)*25
pos=pos+1
rs.moveNext
loop
x=0
do while x<25 and not rs.eof%>
<tr>
<td class=top1> <%if rs("gd")=1 then
response.write"<img src=""images/istop.gif"" alt=""置顶的帖子""> "
elseif rs("jh")=1 then
response.write"<img src=""images/isbest.gif"" alt=""特别推荐"">"
elseif rs("jh")=0 and rs("hits")<50 then
response.write"<img src=""images/folder.gif"" alt=""美女图片""> "
elseif rs("jh")=0 and rs("hits")>=50 then
response.write"<img src=""images/hotfolder.gif"" alt=""大家都喜欢,你呢?"">"
elseif rs("jh")=2 then
response.write"<img src=""images/lockfolder.gif"" alt=""这个就不看了吧!""> "
end if%> <a href="newsfile/<%=rs("url")%>.htm" target="_blank"><%=rs("title")%></a>

</td>
<td class=below4><font size=-1>&nbsp;&nbsp;<%=rs("t")%></font></td>
</tr>
<%x=x+1
rs.movenext
loop
rs.close
set rs=nothing
%>
</table>
<table width="760" border="0" align="center" cellpadding="3" cellspacing="0"

bordercolor="#FF00FF" bgcolor="49ade9">
<form method=post action=index.asp>
<tr>
<td width="52%" > 页次:
<%if page="" then
response.write"1"
else
response.write page
end if%>
/ <%=pageCount%> 页 主题数:<%=RecordCount%></td>
<td width="48%" align="right">
<%if page=1 then
response.write"首页"
else
response.write"<a href=index.asp class=a1>首页</a> "
end if%>
<%if page=1 then %>
上一页
<%else%>
<a href="index.asp?page=<%=page-1%>" class=a1>上一页</a>
<%end if%>
<% y=1%>
<%do while y<pagecount+1%>
<a href="index.asp?page=<%=y%>" class=a1><%=y%></a>
<%
y=y+1
loop%>
<%if cint(page)=pagecount then %>
下一页
<%else%>
<a href="index.asp?page=<%=page+1%>" class="a1">下一页</a>
<%end if%>
转到:
<input onMouseOver="this.style.backgroundColor = '#E5F0FF'" style="BORDER-RIGHT:

#b4b4b4 1px double; BORDER-TOP: #b4b4b4 1px double; BORDER-LEFT: #b4b4b4 1px double; COLOR:

#8888aa; BORDER-BOTTOM: #b4b4b4 1px double; BACKGROUND-COLOR: #ffffff"

onMouseOut="this.style.backgroundColor = ''" maxlength=3 size=3 name=page value="<%=page%>">

<input onMouseOver="this.style.backgroundColor='#FFC864'" style="BORDER-RIGHT: 1px

solid; BORDER-TOP: 1px solid; BORDER-LEFT: 1px solid; COLOR: #000000; BORDER-BOTTOM: 1px

solid; HEIGHT: 18px; BACKGROUND-COLOR: #f3f3f3"

onMouseOut="this.style.backgroundColor='#f3f3f3'" type=submit value=GO name=submit>
</td>
</tr>
</form>
</table>

搜索更多相关主题的帖子: ASP 
2006-06-10 12:05
快速回复:ASP分页问题
数据加载中...
 
   



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

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