ASP分页错误,下一页显示空白 小白在线等高人
<!--#includefile="conn.asp"--><%setrs=server.createobject("ADODB.Recordset")sql="sele...
<!--#include file="conn.asp"-->
<%
set rs=server.createobject("ADODB.Recordset")
sql = "select * from ddbb where ("&sSqlWhere&" like '%"&skeyword&"%')
order by jiage desc"
rs.open sql,conn,1,1 %>
<%
dim sk
sk=Request.QueryString("type")
dim i,intPage,page,pre,last,filepath
rs.PageSize = 20
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
<title>查询结果 </title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="banner"></div>
<div id="content">
<p align="center">统计查询共有
<% Response.Write(RS.RecordCount) %>
条纪录</p>
<% IF rs.eof and rs.bof then
response.write "没有查到请重新查询"
else
%>
<br />
<div style="font-size:14px;fload:center;text-align:center;"><a href="index.html">重新查询
</a></div>
<div align="center">
<center>
<table width="663" border="1" align="center" bordercolor="000000"
bordercolordark="#ffffff" berdorcoorlight="#000000">
<tr align="center">
<td width="50" align="center" bgcolor="#ffffff">ID</td>
这里省略
<td width="73" align="center" bgcolor="#ffffff">其他</td>
</tr>
</table>
<table width="665" border="1" align="center" cellpadding="1" bordercolor="000000"
bordercolordark="#ffffff" berdorcoorlight="#000000">
<tr align="center">
<%
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%>
</tr>
<tr align="center">
<td width="50" align="center" bgcolor="#ffffff"><% =rs("id") %></td>
< 这里省略...
<td width="73" align="center" bgcolor="#ffffff">0</td>
<%
rs.movenext()
next
%>
</tr>
</table>
</center>
<div id="foot1"><a href="soso.asp">首页</a>
<%if pre then%>
<a href="soso.asp?page=<%=intpage -1%>">上页</a>
<%end if%>
<%if last then %>
<a href="soso.asp?page=<%=intpage +1%>">
下页</a>
<%end if %>
<a href="soso.asp?page=<%=rs.PageCount%>">尾页</a>
</div><%end if%><%end if%>
<%
conn.close
set conn=nothing %>
</div>
以上为主要代码
运行后点击下一页的时候页面没有像预期那样有整页数据,而是空白。。
小白在线求解
如何发给你 展开
<%
set rs=server.createobject("ADODB.Recordset")
sql = "select * from ddbb where ("&sSqlWhere&" like '%"&skeyword&"%')
order by jiage desc"
rs.open sql,conn,1,1 %>
<%
dim sk
sk=Request.QueryString("type")
dim i,intPage,page,pre,last,filepath
rs.PageSize = 20
pre = true
last = true
page = trim(Request.QueryString("page"))
if len(page) = 0 then
intpage = 1
pre = false
else
if cint(page) =< 1 then
intpage = 1
pre = false
else
if cint(page) >= rs.PageCount then
intpage = rs.PageCount
last = false
else
intpage = cint(page)
end if
end if
end if
if not rs.eof then
rs.AbsolutePage = intpage
end if
%>
<title>查询结果 </title>
<link href="css.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="container">
<div id="banner"></div>
<div id="content">
<p align="center">统计查询共有
<% Response.Write(RS.RecordCount) %>
条纪录</p>
<% IF rs.eof and rs.bof then
response.write "没有查到请重新查询"
else
%>
<br />
<div style="font-size:14px;fload:center;text-align:center;"><a href="index.html">重新查询
</a></div>
<div align="center">
<center>
<table width="663" border="1" align="center" bordercolor="000000"
bordercolordark="#ffffff" berdorcoorlight="#000000">
<tr align="center">
<td width="50" align="center" bgcolor="#ffffff">ID</td>
这里省略
<td width="73" align="center" bgcolor="#ffffff">其他</td>
</tr>
</table>
<table width="665" border="1" align="center" cellpadding="1" bordercolor="000000"
bordercolordark="#ffffff" berdorcoorlight="#000000">
<tr align="center">
<%
for i=0 to rs.pagesize-1
if rs.bof or rs.eof then exit for
%>
</tr>
<tr align="center">
<td width="50" align="center" bgcolor="#ffffff"><% =rs("id") %></td>
< 这里省略...
<td width="73" align="center" bgcolor="#ffffff">0</td>
<%
rs.movenext()
next
%>
</tr>
</table>
</center>
<div id="foot1"><a href="soso.asp">首页</a>
<%if pre then%>
<a href="soso.asp?page=<%=intpage -1%>">上页</a>
<%end if%>
<%if last then %>
<a href="soso.asp?page=<%=intpage +1%>">
下页</a>
<%end if %>
<a href="soso.asp?page=<%=rs.PageCount%>">尾页</a>
</div><%end if%><%end if%>
<%
conn.close
set conn=nothing %>
</div>
以上为主要代码
运行后点击下一页的时候页面没有像预期那样有整页数据,而是空白。。
小白在线求解
如何发给你 展开
1个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询