跪求高手指点,俺地asp分页显示程序,怎么点“下一页”或“上一页”就是错误或者无法显示呢?
<html><body><divalign=center><%setCONN=server.createobject("adodb.connection")CONN.op...
<html><body>
<div align=center>
<% set CONN=server.createobject("adodb.connection")
CONN.open "dsn=gaga;"
set rs=server.createobject("adodb.recordset")
SQL="SELECT * FROM user "
rs.open SQL,CONN,1,3
IF Not rs.eof Then
proCount=rs.recordcount
rs.PageSize=4 '定义显示数目
if not IsEmpty(Request("ToPage")) then
ToPage=CInt(Request.querystring("ToPage"))
if ToPage>rs.PageCount then
rsnews.AbsolutePage=rs.PageCount
intCurPage=rs.PageCount
elseif ToPage<=0 then
rs.AbsolutePage=1
intCurPage=1
else
rs.AbsolutePage=ToPage
intCurPage=ToPage
end if
else
rs.AbsolutePage=1
intCurPage=1
end if%><table align="center" width="90%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">姓名</td>
<td align="center">密码</td>
<td align="center">email</td><td align="center">工资</td><td align="center">年龄</td>
</tr>
<%intCurPage=CInt(intCurPage)
For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if
%>
<tr>
<td><%=rs("姓名")%></td>
<td><%=rs("密码")%></td>
<td><%=rs("email")%></td>
<td><%=rs("工资")%></td>
<td><%=rs("年龄")%></td>
</tr>
<%
rs.MoveNext
next
%>
<%else%>
<%end if%>
<%
rs.close
set rs=nothing
%></table>
<table align="center" width="90%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="center" valign="middle">
<a href="ss.asp?ToPage="&<%=(ToPage-1)%> onFocus="this.blur()">上一页</a>
<a href="ss.asp?ToPage="&<%=(ToPage+1)%> onFocus="this.blur()">下一页</a>
</td>
</tr>
</table></div>
</body></html> 展开
<div align=center>
<% set CONN=server.createobject("adodb.connection")
CONN.open "dsn=gaga;"
set rs=server.createobject("adodb.recordset")
SQL="SELECT * FROM user "
rs.open SQL,CONN,1,3
IF Not rs.eof Then
proCount=rs.recordcount
rs.PageSize=4 '定义显示数目
if not IsEmpty(Request("ToPage")) then
ToPage=CInt(Request.querystring("ToPage"))
if ToPage>rs.PageCount then
rsnews.AbsolutePage=rs.PageCount
intCurPage=rs.PageCount
elseif ToPage<=0 then
rs.AbsolutePage=1
intCurPage=1
else
rs.AbsolutePage=ToPage
intCurPage=ToPage
end if
else
rs.AbsolutePage=1
intCurPage=1
end if%><table align="center" width="90%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center">姓名</td>
<td align="center">密码</td>
<td align="center">email</td><td align="center">工资</td><td align="center">年龄</td>
</tr>
<%intCurPage=CInt(intCurPage)
For i = 1 to rs.PageSize
if rs.EOF then
Exit For
end if
%>
<tr>
<td><%=rs("姓名")%></td>
<td><%=rs("密码")%></td>
<td><%=rs("email")%></td>
<td><%=rs("工资")%></td>
<td><%=rs("年龄")%></td>
</tr>
<%
rs.MoveNext
next
%>
<%else%>
<%end if%>
<%
rs.close
set rs=nothing
%></table>
<table align="center" width="90%" border="1" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="25" align="center" valign="middle">
<a href="ss.asp?ToPage="&<%=(ToPage-1)%> onFocus="this.blur()">上一页</a>
<a href="ss.asp?ToPage="&<%=(ToPage+1)%> onFocus="this.blur()">下一页</a>
</td>
</tr>
</table></div>
</body></html> 展开
展开全部
ToPage没有定义初始值?可以在程序中定义一下初始值,或者将:
<a href="ss.asp?ToPage="&<%=(ToPage-1)%> onFocus="this.blur()">上一页</a>
<a href="ss.asp?ToPage="&<%=(ToPage+1)%> onFocus="this.blur()">下一页</a>
改成:
<a href="ss.asp?ToPage=<%=(intCurPage-1)%>" onFocus="this.blur()">上一页</a>
<a href="ss.asp?ToPage=<%=(intCurPage+1)%>" onFocus="this.blur()">下一页</a>
<a href="ss.asp?ToPage="&<%=(ToPage-1)%> onFocus="this.blur()">上一页</a>
<a href="ss.asp?ToPage="&<%=(ToPage+1)%> onFocus="this.blur()">下一页</a>
改成:
<a href="ss.asp?ToPage=<%=(intCurPage-1)%>" onFocus="this.blur()">上一页</a>
<a href="ss.asp?ToPage=<%=(intCurPage+1)%>" onFocus="this.blur()">下一页</a>
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<a href="ss.asp?ToPage="&<%=(ToPage-1)%> onFocus="this.blur()">上一页</a>
<a href="ss.asp?ToPage="&<%=(ToPage+1)%> onFocus="this.blur()">下一页</a>
其他没看 不过估计是你这2行有问题!
改成这样试试
href="ss.asp?ToPage=<%=(ToPage-1)%>"
<a href="ss.asp?ToPage="&<%=(ToPage+1)%> onFocus="this.blur()">下一页</a>
其他没看 不过估计是你这2行有问题!
改成这样试试
href="ss.asp?ToPage=<%=(ToPage-1)%>"
追问
还是不行啊!高手请帮忙支个招!!谢谢!!!!!!
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询