<%
if i mod 3=0 then
response.Write"</tr><tr>"
end if
rs.movenext
i=i+1
if rs.eof then
j = j + 1
exit for
end if
next
response.Write"</tr></table>"
end if%>
</tr>
<tr>
<td>
<%
if j=6 then
response.write "<div align=center>"
response.write "第<font color=red>" + cstr(curpage) + "</font>页/总<font color=red>" + cstr(rs.pagecount) + "</font>页 "
response.write "本页<font color=red>" + cstr(i-1) + "</font>条/总<font color=red>" + cstr(rs.recordcount) + "</font>条 "
if curpage = 1 then
response.write "首页 前页 "
else
response.write "<a href='produ.asp?id=" & cstr(request("id")) & "&page=1'>首页</a> <a href='produ.asp?id=" & cstr(request("id")) & "&page=" & cstr(curpage-1) & "'>前页</a> "
end if
if int(curpage) = int(rs.pagecount) then
response.write "后页 末页"
else
response.write "<a href='produ.asp?typeid=" & cstr(request("typeid")) & "&page=" & cstr(curpage+1) & "'>后页</a> <a href='produ.asp?id=" & cstr(request("id")) & "&page=" & cstr(rs.pagecount) & "'>末页</a>"
end if
end if
%>
我想 一个东西 显示出了6个 就显示出下一个分页 语句
我知道可以用 if 来判断但是
我前面写了 if rs.eof then
j = j + 1
我后面就得不到 j 的数
response.Write j 我用这个输出 可以显示 J的数 但是我加 if j=6 then 分页代码 end if 就不行 到了 6个不会显示
麻烦加我下QQ 120019268
ASP 判断+显示
答案:1 悬赏:50 手机版
解决时间 2021-02-08 14:16
- 提问者网友:雨不眠的下
- 2021-02-07 20:53
最佳答案
- 五星知识达人网友:纵马山川剑自提
- 2021-02-07 22:21
<%
Set rs=server.CreateObject("adodb.recordset")
rs.open strsql,conn,1,1 '注意这里
curpage=request("curpage")
If Not IsNumeric(curpage) Then
curpage=1
Else
curpage=CInt(curpage)
End if
If Not rs.eof Then
rs.pagesize=6
pgcount=rs.pagecount
If curpage>pgcount Then curpage=pgcount
If curpage<0 Then curpage=1
rs.absolutepage=curpage
Do While Not rs.eof
if i mod 3=0 then
response.Write"</tr><tr>"
end if
i=i+1
If i>rs.pagesize Then Exit do
rs.movenext
Loop
response.Write"</tr></table>"
end If
%>
</tr>
<tr>
<td>
<%
if curpage>1 then
response.write "<div align=center>"
response.write "第<font color=red>" + cstr(curpage) + "</font>页/总<font color=red>" + cstr(rs.pagecount) + "</font>页 "
response.write "本页<font color=red>" + cstr(i-1) + "</font>条/总<font color=red>" + cstr(rs.recordcount) + "</font>条 "
if curpage = 1 then
response.write "首页 前页 "
else
response.write "<a href='produ.asp?id=" & cstr(request("id")) & "&page=1'>首页</a> <a href='produ.asp?id=" & cstr(request("id")) & "&page=" & cstr(curpage-1) & "'>前页</a> "
end if
if int(curpage) = int(rs.pagecount) then
response.write "后页 末页"
else
response.write "<a href='produ.asp?typeid=" & cstr(request("typeid")) & "&page=" & cstr(curpage+1) & "'>后页</a> <a href='produ.asp?id=" & cstr(request("id")) & "&page=" & cstr(rs.pagecount) & "'>末页</a>"
end if
end if
%>
Set rs=server.CreateObject("adodb.recordset")
rs.open strsql,conn,1,1 '注意这里
curpage=request("curpage")
If Not IsNumeric(curpage) Then
curpage=1
Else
curpage=CInt(curpage)
End if
If Not rs.eof Then
rs.pagesize=6
pgcount=rs.pagecount
If curpage>pgcount Then curpage=pgcount
If curpage<0 Then curpage=1
rs.absolutepage=curpage
Do While Not rs.eof
if i mod 3=0 then
response.Write"</tr><tr>"
end if
i=i+1
If i>rs.pagesize Then Exit do
rs.movenext
Loop
response.Write"</tr></table>"
end If
%>
</tr>
<tr>
<td>
<%
if curpage>1 then
response.write "<div align=center>"
response.write "第<font color=red>" + cstr(curpage) + "</font>页/总<font color=red>" + cstr(rs.pagecount) + "</font>页 "
response.write "本页<font color=red>" + cstr(i-1) + "</font>条/总<font color=red>" + cstr(rs.recordcount) + "</font>条 "
if curpage = 1 then
response.write "首页 前页 "
else
response.write "<a href='produ.asp?id=" & cstr(request("id")) & "&page=1'>首页</a> <a href='produ.asp?id=" & cstr(request("id")) & "&page=" & cstr(curpage-1) & "'>前页</a> "
end if
if int(curpage) = int(rs.pagecount) then
response.write "后页 末页"
else
response.write "<a href='produ.asp?typeid=" & cstr(request("typeid")) & "&page=" & cstr(curpage+1) & "'>后页</a> <a href='produ.asp?id=" & cstr(request("id")) & "&page=" & cstr(rs.pagecount) & "'>末页</a>"
end if
end if
%>
我要举报
如以上问答信息为低俗、色情、不良、暴力、侵权、涉及违法等信息,可以点下面链接进行举报!
大家都在看
推荐资讯