自动换页简单问题(100分)!!

xinyuewanqian 2003-09-26 11:34:36
我想知道asp例如新闻,论坛,留言板,怎么能让其妹也显示固定几条,从新自动建页,在下方自动出现“上一页”“下一页”,查询等功!!!谢谢,最好给我一个,论谈之类的例子!!!如果有完整例子,可以再加!!!
...全文
42 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
  • 打赏
  • 举报
回复
在下一个看看
  • 打赏
  • 举报
回复
itcoco 2003-09-27
  • 打赏
  • 举报
回复
本页换成你所作的叶面的名字
<% if not isempty(request("page"))then
pagecount=cint(request("page"))
else
pagecount=1
end if
rs.pagesize=5
if pagecount>rs.pagecount or pagecount<=0 then
pagecount=1
end if
rs.absolutepage=pagecount%>
<%if rs.pagecount=1 then%>
<tr> <td colspan="4">目前一共有<%=rs.recordcount%>条信息,以下是[<font color="#FF0000">1</font>~<font color="#FF0000"><%=rs.recordcount%></font>]条:</td> </tr> <%else %> <% page_start=(pagecount-1)*rs.pagesize+1
page_end=rs.pagesize*pagecount
if pagecount*rs.pagesize=>rs.recordcount then
page_end=rs.recordcount
end if
%> <tr>
<td align="center" colspan="2"> 目前一共有[<font color="#FF0000"><%=rs.recordcount%></font>]条信息,以下是[<font color="#FF0000"><%=page_start%></font>~<font color="#FF0000"><%=page_end%></font>]条:</td>
</tr> <tr>
<td colspan="3">
<% response.write"<form name=go2to form method=Post action=本页.asp>"
if pagecount=1 then response.write " 首页 上一页  "
else
response.write "<a href=本页.asp?page=1> 首页 </a>  "
response.write "<a href=本页.asp?page="+cstr(pagecount-1)+"> 上一页 </a>  "
end if
if rs.PageCount-pagecount<1 then
response.write " 下一页 尾页" else
response.write "<a href=本页.asp?page="+cstr(pagecount+1)+"> 下一页 </a> "
response.write "<a href=本页.asp?page="+cstr(rs.PageCount)+"> 尾页 </a>"
end if
response.write " 页次:"&_
pagecount&"/"&rs.pagecount&"页,"
response.write "转到第<input type='text' "&_
"name='page' size=2 maxLength=3 style='font-size:"&_
" 12px;height:"&_
" 18' value="&PageCount&">页 "
response.write "<input class=button type='button' value='确 定' "&_
"onclick=check() style='font-size:12px; position: relative; height: 19'>" %>
<%end if%>
</td>
<td width="1%"></form>
</tr>
<% for i=1 to rs.pagesize%>
<tr bordercolor="#E1873E">
<td nowrap bgcolor="#FFFFFF"><%=rs("time")%></td>
<td bgcolor="#FFFFFF"><img src="images/arrow.gif" width="11" height="11">
<a href="显示记录的叶面.asp?id=<%=rs("id")%>"> <%=left(rs("title"),30)%></a></td>
</tr>
<%rs.movenext
if rs.eof then
i=i+1
exit for
end if
next
%>
<%end if%>
  • 打赏
  • 举报
回复
随便下个ASP代码看看里面多的是
hzqq 2003-09-26
  • 打赏
  • 举报
回复
分两段啦
一开始
select * from .. where top=1
然后正常的
makay 2003-09-26
  • 打赏
  • 举报
回复
下个动网新闻看看,里面有。
nchen123 2003-09-26
  • 打赏
  • 举报
回复
在这里用"搜索"功能,输入关键字 "分页", 太多了。

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧