分页显示问题,显示总页数与“首页,下一页。。”无法正常使用
我的代码为何无法将共页多少页显示清楚,无论有多少记录都只显示第一页的4条记录(我设置的是每页显示4条)
一下是代码:
<%
Dim intCur,intTotal,I
'Dim connX,rst,strConnX,strSQL
dim rsX_numRows
If Request.ServerVariables("CONTENT_LENGTH") = 0 Then
intCur = 1
Else
intCur = CInt(Request.Form("CurPage"))
Select Case Request.form("Page")
Case"首页"
intCur = 1
Case"上一页"
intCur = intCur - 1
Case"下一页"
intCur = intCur + 1
Case"尾页"
intCur = CInt(Request.Form("LastPage"))
End Select
End If
set rsX=server.createobject("adodb.recordset")
rsX.CursorLocation = 2
rsX.CursorType = adOpenStatic
sql="select biaoti,neirong,chuchu,faburiqi from xinqingyizhan order by id desc"
rsX.open sql,connX,1,1
If Not rsX.EOF Then
rsX.AbsolutePage = intCur
End If
intTotal = rsX.PageCount
%>
<%
Dim Repeat2__numRows
Dim Repeat2__index
Repeat2__numRows = 4
Repeat2__index = 0
rsX_numRows = rsX_numRows + Repeat2__numRows
%>
显示部分代码:
<form action="<% =request.ServerVariables("SCRIPT_NAME")%>"METHOD="POST">
<INPUT TYPE="Hidden"NAME="CurPage"VALUE="<% =intCur%>">
<INPUT TYPE="Hidden"NAME="LastPage"VALUE="<% =intTotal%>">
<INPUT TYPE="Submit"NAME="Page"VALUE="首页">
<% If intCur > 1 Then %>
<INPUT TYPE="Submit"NAME="Page"VALUE="上一页">
<% End If %>
<% If intCur <> intTotal Then %>
<INPUT TYPE="Submit"NAME="Page"VALUE="下一页">
<% End If %>
<INPUT TYPE="Submit"NAME="Page"VALUE="尾页">
</form>