ASP翻页问题 看了一个下午没看出破绽 帮帮忙吧
tempS.Open "SQL",tempC,3,1
tempS.PageSize=3
tempS.AbsolutePage=CLng(2)
-------------
如果这个表有10条记录
这样的话会返回那几条记录啊
我认为是
10条先会以3条记录为一个页面
1~3 4~6 7~9 10
共4个页面对吗
然后我定位到第二个页面
应该是4~6呀
是这样理解的吗 (我发现这样还是显示 1~3条记录)以下是全部代码
====================================================
<table width="792" border="1">
<tr align="center">
<h1>学生信息管理模块</h1>
</tr>
<tr>
<%
Response.Write ("<td>用户名</td><td>真实姓名</td><td>性别</td><td>电话</td><td>Email</td><td>地址</td><td>邮编</td>")
%>
</tr>
<!--#include file ="dbcl.inc"-->
<%
dim NowPage
set tempS=Server.CreateObject("ADODB.Recordset")
if Request("FLAG")="" then
tempS.Open "select UserLog.*,UserInfo.RealName,UserInfo.UserSex,UserInfo.UserBirthday,UserInfo.UserPhone,UserInfo.UserEmail,UserInfo.UserAdds,UserInfo.UserPc from UserLog inner join UserInfo on UserLog.UserID=UserInfo.UserID",tempC,3,1
tempS.PageSize=3
tempS.AbsolutePage=CLng(1)
NowPage=1
else
tempS.Open "select UserLog.*,UserInfo.RealName,UserInfo.UserSex,UserInfo.UserBirthday,UserInfo.UserPhone,UserInfo.UserEmail,UserInfo.UserAdds,UserInfo.UserPc from UserLog inner join UserInfo on UserLog.UserID=UserInfo.UserID",tempC,3,1
tempS.PageSize=3
tempS.AbsolutePage=CLng(Request("FLAG"))
NowPage=Request("FLAG")
end if
if tempS.EOF = false and tempS.BOF =false then
tempS.MoveFirst
for i=1 to tempS.PageSize
Response.Write ("<tr>")
Response.Write ("<td>")
Response.Write (tempS.Fields(1).Value)
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (tempS.Fields(4).Value)
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (tempS.Fields(5).Value)
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (tempS.Fields(7).Value)
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (tempS.Fields(8).Value)
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (tempS.Fields(9).Value)
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write (tempS.Fields(10).Value)
Response.Write ("</td>")
Response.Write ("<td>")
Response.Write ("<button onClick=""window.location='UserMod.asp?UseMod=" & tempS.Fields(0).Value & "'"" >修改</button>")
Response.Write ("<button onClick=""window.location='Manage.asp?UseDel=" & tempS.Fields(0).Value & "'"" >删除</button>")
Response.Write ("</td>")
Response.Write ("</tr>")
tempS.MoveNext
next
end if
Response.Write ("<tr><center>")
Response.Write ("总共" & tempS.PageCount & "页 " & "当前第" & NowPage & "页" )
Response.Write ("<a href=""StudentManage.asp?FLAG=1"">第一页</a>" )
Response.Write (" ")
if NowPage-1 > 0 then
Response.Write ("<a href=""StudentManage.asp?FLAG=" & NowPage-1 & """>上一页</a>" )
end if
if NowPage+1 <= tempS.PageCount then
Response.Write ("<a href=""StudentManage.asp?FLAG=" & NowPage+1 & """>下一页</a>" )
end if
Response.Write ("</center></tr>")
tempS.Close
set tempS=Nothing
%>
</table>