现在是没有数据显示 记录:4/0 页数0/0条 首页 上一页 下一页 末页
我想让他这么显示
没有评论 什么记录 首页 什么的因为没有数据就不显示
Const PicPageNum = 4
Set Rs=Server.CreateObject("Adodb.RecordSet")
Sql = "select commentuser,commentdate,commenttext,commentreply from comment where commentparentid="&id&" order by commentparentid asc"
Rs.Open sql,Conn,3,1
page=Trim(page)
Rs.pagesize=PicPageNum
page=clng(page)
if page<1 then page=1 end if
if page>Rs.pagecount then page=Rs.pagecount end if
if not (Rs.bof or Rs.eof) then
Rs.absolutepage=page
end if
for i=1 to Rs.pagesize
if Rs.eof then exit for
%>
<div class="comment">
<div class="comment-caption">第<%=i+1+(page*rs.PageSize-rs.PageSize)%>楼 <span class="comment-user"><%=Rs(0)%> 发表于 </span> <span class="comment-date"><%=Rs(1)%></span></div>
<div class="comment-text"><%=Rs(2)%></div>
<%If Rs(3)<>"" Then%>
<div class="comment-reply">回复:<%=Rs(3)%></div>
<%End If%>
</div>
<%
Rs.MoveNext
Next
%>
<div class="pagebar">记录:<b><font color="#FF0000"><%=Rs.pagesize%></font>/<%=Rs.recordcount%></b> 页数<b><%=page%>/<%=Rs.pagecount%></b>条 <%=pageInc(Rs.pagecount)%></div>
<%
Rs.Close:Set Rs=Nothing
End Function
大家帮我看看ASP翻页
答案:1 悬赏:60
解决时间 2021-04-27 05:42
- 提问者网友:浪子生来ˇ性放荡²↘
- 2021-04-27 02:42
最佳答案
- 二级知识专家网友:深街酒徒
- 2021-04-27 03:16
<div class="pagebar">记录:<b><font color="#FF0000"><%=Rs.pagesize%></font>/<%=Rs.recordcount%></b> 页数<b><%=page%>/<%=Rs.pagecount%></b>条 <%=pageInc(Rs.pagecount)%></div>
在这段中加个判断。
<% if rs.recordcount = 0 then %>
<div class="pagebar">没有评论 什么记录 首页 什么的因为没有数据就不显示</div>
<% else %>
<div class="pagebar">记录:<b><font color="#FF0000"><%=Rs.pagesize%></font>/<%=Rs.recordcount%></b> 页数<b><%=page%>/<%=Rs.pagecount%></b>条 <%=pageInc(Rs.pagecount)%></div>
<% end if %>
我要举报
如以上问答内容为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯