问答文章1 问答文章501 问答文章1001 问答文章1501 问答文章2001 问答文章2501 问答文章3001 问答文章3501 问答文章4001 问答文章4501 问答文章5001 问答文章5501 问答文章6001 问答文章6501 问答文章7001 问答文章7501 问答文章8001 问答文章8501 问答文章9001 问答文章9501

asp分页问题,求高手解答

发布网友 发布时间:2022-05-01 13:52

我来回答

1个回答

热心网友 时间:2023-10-16 09:13

<body>
<!--#include file="inc/logotop.asp" -->
<!--#include file="inc/sys.asp"-->
<%
sub titlen(i)
tlen=rs("topic")
if len(tlen)>i then
tlen=left(tlen,i)&"..."
else
tlen=tlen
end if
end sub
'设置每页显示数量
Const PAGESIZE=8
'设置略显示多少页
Const PARTSIZE=10
dim tlen
tlen=""
AProctClass=trim(request("ProctClass"))
dim pagecount,page,Spage,Epage,recordcount,i
page = request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
page = Cint(page)
%>

<%
call checkform()
ProctClass=request("ProctClass")
ClassName=request("ClassName")

if proctclass = "" then
set rsc=conn.execute("select top 1 * from tproctclass where ver=0 order by sortno")
call DoError()
if not rsc.eof then
proctclass = rsc("classid")
classname = rsc("classname")
end if
rsc.close()
set rsc = nothing
end if

sql = "select * from tproct where ver=0 "
if ProctClass <> "" then
sql = sql & " and ProctClass="&cstr(ProctClass)
end if
sql = sql & " order by sortno"
rs.open sql,conn,1,1
recordcount = RS.RecordCount
RS.PageSize = PAGESIZE
pagecount = RS.PageCount
if page < 1 then
page = 1
elseif page > pagecount then
page = pagecount
end if
if RS.EOF then
Response.Write("<center><font color=red>目前还没有内容</font>")
else
if recordcount > 0 then RS.AbsolutePage = page
call DoError()
%>

<!--#include file="inc/left_tel.asp" --></td>
</tr>
</tbody>
</table>
<p> </p></td>
<td width="619" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#f1f1f1" class="td_nybt">
<img src="images/bullet_snav_cap.gif" width="12" height="12"> <%=classname%> </td>
</tr>
<tr>
<td height="1" bgcolor="#666666"></td>
</tr>
</table>
<br>

<TABLE width=94% height="117" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<%
for i = 1 to PAGESIZE
if RS.EOF then exit for
call titlen(listlen)
%>
<TR vAlign=middle align=left>
<TD height="115" align="left"><a href="proct_detail.asp?proctid=<%=rs("proctid")%>"><img src="proct/<%=rs("defaultpicurl")%>" width=152 height=140 border="0"></a></TD>
<% call DoError() %>
<TD><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="69%" height="22"><strong> <%=rs("proctname")%></strong></td>
<td width="31%"><a href="proct_detail.asp?proctid=<%=rs("proctid")%>"><img src="images/PRODUCT/title_news.gif" width="70" height="23" border="0"></a></td>
</tr>
<tr>
<td colspan="2" class="td1en"><%=rs("summary")%></td>
</tr>
</table></TD>
</TR>
<TR>
<TD width=28% height="1" bgcolor="#E2E7EA"></TD>
<TD width=72% height="1" bgcolor="#E2E7EA"></TD>
</TR>
<%
rs.movenext
next
rs.close
set rs = nothing
%>
</TBODY>
</TABLE>
<br>
<%if pagecount > 0 then
response.write("<table width=""95%"" align=center cellspacing=3 cellpadding=3><tr><td align=right>")
response.write("页次:<font color=red><b>" & page & "</font>/" & pagecount & "</b>  每页<b>" & pagesize & "</b>  共<b>" & recordcount & "</b>  条:")
Spage = page mod PARTSIZE
if page > PARTSIZE then
if Spage = 0 then Spage = PARTSIZE
Spage = page - Spage + 1
else
Spage = 1
end if
Epage = Spage + PARTSIZE - 1
if Epage > pagecount then Epage = pagecount
if page > PARTSIZE then
response.write("<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & Spage - 1 & """>[<<]</a>")
end if
for i = Spage to Epage
if i = page then
response.write("[<font color=red><b>" & i & "</b></font>]")
else
response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & i & """>" & i & "</a>]")
end if
next
if Epage < pagecount then
response.write("<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & Epage + 1 & """>[>>]</a>")
end if
if Spage <> 1 then response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=1"">首页</a>]")
if Epage <> pagecount then response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & pagecount & """>尾页</a>]")
response.write("</td></tr></table><br>")
end if
rs.close
set rs=nothing
%>
</td>
<td width="1" bgcolor="#D6D6D6"></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="inc/foot.asp" -->
</body>
</html>
<!--#include file="inc/kefu_index.asp"-->
<%
set rsss=nothing
set rss=nothing
set rs=nothing
set conn=nothing
%>

你自己测试一下,有问题给我留言。

热心网友 时间:2023-10-16 09:13

<body>
<!--#include file="inc/logotop.asp" -->
<!--#include file="inc/sys.asp"-->
<%
sub titlen(i)
tlen=rs("topic")
if len(tlen)>i then
tlen=left(tlen,i)&"..."
else
tlen=tlen
end if
end sub
'设置每页显示数量
Const PAGESIZE=8
'设置略显示多少页
Const PARTSIZE=10
dim tlen
tlen=""
AProctClass=trim(request("ProctClass"))
dim pagecount,page,Spage,Epage,recordcount,i
page = request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
page = Cint(page)
%>

<%
call checkform()
ProctClass=request("ProctClass")
ClassName=request("ClassName")

if proctclass = "" then
set rsc=conn.execute("select top 1 * from tproctclass where ver=0 order by sortno")
call DoError()
if not rsc.eof then
proctclass = rsc("classid")
classname = rsc("classname")
end if
rsc.close()
set rsc = nothing
end if

sql = "select * from tproct where ver=0 "
if ProctClass <> "" then
sql = sql & " and ProctClass="&cstr(ProctClass)
end if
sql = sql & " order by sortno"
rs.open sql,conn,1,1
recordcount = RS.RecordCount
RS.PageSize = PAGESIZE
pagecount = RS.PageCount
if page < 1 then
page = 1
elseif page > pagecount then
page = pagecount
end if
if RS.EOF then
Response.Write("<center><font color=red>目前还没有内容</font>")
else
if recordcount > 0 then RS.AbsolutePage = page
call DoError()
%>

<!--#include file="inc/left_tel.asp" --></td>
</tr>
</tbody>
</table>
<p> </p></td>
<td width="619" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#f1f1f1" class="td_nybt">
<img src="images/bullet_snav_cap.gif" width="12" height="12"> <%=classname%> </td>
</tr>
<tr>
<td height="1" bgcolor="#666666"></td>
</tr>
</table>
<br>

<TABLE width=94% height="117" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<%
for i = 1 to PAGESIZE
if RS.EOF then exit for
call titlen(listlen)
%>
<TR vAlign=middle align=left>
<TD height="115" align="left"><a href="proct_detail.asp?proctid=<%=rs("proctid")%>"><img src="proct/<%=rs("defaultpicurl")%>" width=152 height=140 border="0"></a></TD>
<% call DoError() %>
<TD><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="69%" height="22"><strong> <%=rs("proctname")%></strong></td>
<td width="31%"><a href="proct_detail.asp?proctid=<%=rs("proctid")%>"><img src="images/PRODUCT/title_news.gif" width="70" height="23" border="0"></a></td>
</tr>
<tr>
<td colspan="2" class="td1en"><%=rs("summary")%></td>
</tr>
</table></TD>
</TR>
<TR>
<TD width=28% height="1" bgcolor="#E2E7EA"></TD>
<TD width=72% height="1" bgcolor="#E2E7EA"></TD>
</TR>
<%
rs.movenext
next
rs.close
set rs = nothing
%>
</TBODY>
</TABLE>
<br>
<%if pagecount > 0 then
response.write("<table width=""95%"" align=center cellspacing=3 cellpadding=3><tr><td align=right>")
response.write("页次:<font color=red><b>" & page & "</font>/" & pagecount & "</b>  每页<b>" & pagesize & "</b>  共<b>" & recordcount & "</b>  条:")
Spage = page mod PARTSIZE
if page > PARTSIZE then
if Spage = 0 then Spage = PARTSIZE
Spage = page - Spage + 1
else
Spage = 1
end if
Epage = Spage + PARTSIZE - 1
if Epage > pagecount then Epage = pagecount
if page > PARTSIZE then
response.write("<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & Spage - 1 & """>[<<]</a>")
end if
for i = Spage to Epage
if i = page then
response.write("[<font color=red><b>" & i & "</b></font>]")
else
response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & i & """>" & i & "</a>]")
end if
next
if Epage < pagecount then
response.write("<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & Epage + 1 & """>[>>]</a>")
end if
if Spage <> 1 then response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=1"">首页</a>]")
if Epage <> pagecount then response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & pagecount & """>尾页</a>]")
response.write("</td></tr></table><br>")
end if
rs.close
set rs=nothing
%>
</td>
<td width="1" bgcolor="#D6D6D6"></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="inc/foot.asp" -->
</body>
</html>
<!--#include file="inc/kefu_index.asp"-->
<%
set rsss=nothing
set rss=nothing
set rs=nothing
set conn=nothing
%>

你自己测试一下,有问题给我留言。

热心网友 时间:2023-10-16 09:13

<body>
<!--#include file="inc/logotop.asp" -->
<!--#include file="inc/sys.asp"-->
<%
sub titlen(i)
tlen=rs("topic")
if len(tlen)>i then
tlen=left(tlen,i)&"..."
else
tlen=tlen
end if
end sub
'设置每页显示数量
Const PAGESIZE=8
'设置略显示多少页
Const PARTSIZE=10
dim tlen
tlen=""
AProctClass=trim(request("ProctClass"))
dim pagecount,page,Spage,Epage,recordcount,i
page = request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
page = Cint(page)
%>

<%
call checkform()
ProctClass=request("ProctClass")
ClassName=request("ClassName")

if proctclass = "" then
set rsc=conn.execute("select top 1 * from tproctclass where ver=0 order by sortno")
call DoError()
if not rsc.eof then
proctclass = rsc("classid")
classname = rsc("classname")
end if
rsc.close()
set rsc = nothing
end if

sql = "select * from tproct where ver=0 "
if ProctClass <> "" then
sql = sql & " and ProctClass="&cstr(ProctClass)
end if
sql = sql & " order by sortno"
rs.open sql,conn,1,1
recordcount = RS.RecordCount
RS.PageSize = PAGESIZE
pagecount = RS.PageCount
if page < 1 then
page = 1
elseif page > pagecount then
page = pagecount
end if
if RS.EOF then
Response.Write("<center><font color=red>目前还没有内容</font>")
else
if recordcount > 0 then RS.AbsolutePage = page
call DoError()
%>

<!--#include file="inc/left_tel.asp" --></td>
</tr>
</tbody>
</table>
<p> </p></td>
<td width="619" align="center" valign="top" bgcolor="#FFFFFF"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" bgcolor="#f1f1f1" class="td_nybt">
<img src="images/bullet_snav_cap.gif" width="12" height="12"> <%=classname%> </td>
</tr>
<tr>
<td height="1" bgcolor="#666666"></td>
</tr>
</table>
<br>

<TABLE width=94% height="117" border=0 cellPadding=0 cellSpacing=0>
<TBODY>
<%
for i = 1 to PAGESIZE
if RS.EOF then exit for
call titlen(listlen)
%>
<TR vAlign=middle align=left>
<TD height="115" align="left"><a href="proct_detail.asp?proctid=<%=rs("proctid")%>"><img src="proct/<%=rs("defaultpicurl")%>" width=152 height=140 border="0"></a></TD>
<% call DoError() %>
<TD><table width="98%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="69%" height="22"><strong> <%=rs("proctname")%></strong></td>
<td width="31%"><a href="proct_detail.asp?proctid=<%=rs("proctid")%>"><img src="images/PRODUCT/title_news.gif" width="70" height="23" border="0"></a></td>
</tr>
<tr>
<td colspan="2" class="td1en"><%=rs("summary")%></td>
</tr>
</table></TD>
</TR>
<TR>
<TD width=28% height="1" bgcolor="#E2E7EA"></TD>
<TD width=72% height="1" bgcolor="#E2E7EA"></TD>
</TR>
<%
rs.movenext
next
rs.close
set rs = nothing
%>
</TBODY>
</TABLE>
<br>
<%if pagecount > 0 then
response.write("<table width=""95%"" align=center cellspacing=3 cellpadding=3><tr><td align=right>")
response.write("页次:<font color=red><b>" & page & "</font>/" & pagecount & "</b>  每页<b>" & pagesize & "</b>  共<b>" & recordcount & "</b>  条:")
Spage = page mod PARTSIZE
if page > PARTSIZE then
if Spage = 0 then Spage = PARTSIZE
Spage = page - Spage + 1
else
Spage = 1
end if
Epage = Spage + PARTSIZE - 1
if Epage > pagecount then Epage = pagecount
if page > PARTSIZE then
response.write("<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & Spage - 1 & """>[<<]</a>")
end if
for i = Spage to Epage
if i = page then
response.write("[<font color=red><b>" & i & "</b></font>]")
else
response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & i & """>" & i & "</a>]")
end if
next
if Epage < pagecount then
response.write("<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & Epage + 1 & """>[>>]</a>")
end if
if Spage <> 1 then response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=1"">首页</a>]")
if Epage <> pagecount then response.write("[<a href=""?d_id="&d_id&"&ProctClass=" & AProctClass & "&page=" & pagecount & """>尾页</a>]")
response.write("</td></tr></table><br>")
end if
rs.close
set rs=nothing
%>
</td>
<td width="1" bgcolor="#D6D6D6"></td>
</tr>
</table>
</td>
</tr>
</table>
<!--#include file="inc/foot.asp" -->
</body>
</html>
<!--#include file="inc/kefu_index.asp"-->
<%
set rsss=nothing
set rss=nothing
set rs=nothing
set conn=nothing
%>

你自己测试一下,有问题给我留言。
声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com
电脑如何一键还原系统电脑一键还原怎么操作 神舟笔记本电脑怎么重新设置神舟战神bios恢复出厂设置 神舟电脑恢复出厂设置神舟战神怎么恢复原厂系统 水泥楼梯如何铺木楼梯 家里面楼梯是水泥的不想铺地毯或者地砖还能铺什么 楼梯的水泥台阶上可以铺地板革吗 手机腾讯会议共享屏幕播放视频没声 腾讯会议共享屏幕没声音怎么办 微信寄快递怎么取消订单_取消订单方法介绍 300兆宽带用什么路由器好? 为什么我下载安装了一个手机管家后手机QQ就登陆不上去?重新下载了手机的新版本后还是登陆不了? 一什么大海(量词) 一()笼子,一()海洋,一()合作,一()灾难,填量词 手机管家登入QQ账号已失效 为什么qq登录手机管家时显示登录失效 一()海水,在括号里填上量词 帮我填一下量词 一( )海兽 一( )骆驼 一( )海洋 我今年19了不会26英文字母 韩语自我介绍 WWE中神秘人雷尔的资料 一( )海洋?填量词 英文二十六个字母怎么读 谁老看WWE? WWE的超级巨星杰夫·哈迪和神秘人雷尔的资料 车牌号鲁eny619在什么位置 豫s.en619 纳米防盗网是什么材质 2天时间南京有什么好玩的景点可以推荐? 想去南京玩两天,有哪些景点可去?,消费大概是多少呢,两个人,而且要住宿……,谢谢, 十一去南京玩,但时间只有两天左右,怎么安排才好玩啊 QQ手机管家同步时登陆失败,错误码255 一( )海,用什么量词 一什么大海 腾讯手机管家怎么总是登录失败? 为什么qq不能登录手机管家,显示登陆失败 用恰当的量词填空。一( )声音 一( )大海 腾讯手机管家里的个人中心,在手机重启后自动退出,用QQ和微信都登陆不了。 大海用什么量词形容? 一什么海鸥填量词一个 QQ手机管家更新后无法登陆 其他权益工具投资可写明细科目如成本,cpa考试时候哪几个科目一定要写明细科目的 气体检测仪上为什么标有氧气,怎么不标空气? 其他权益工具投资在科目年终汇总表怎么填 气体检测仪可以检氮气吗 其他权益工具投资科目余额,填列在资产负债表的哪个科目里呢? 泵吸式单气体检测仪 氮气的高报设置和低报设置 其他权益工具投资科目是属于资产类科目还是所有者权益类? 有没有氮气和氧气二合一的气体检测仪 气体检测预警仪能检测多少种气体? 想买一台气体分析仪,能检测二氧化碳,氮气,氧气,二氧化硫等混合气体中,各气体的含量的?