asp分页显示问题

asp分页显示问题
215个 首页 上一页 下一页 尾页 页次:1/11页 20条记录/页
结果显示正确,可是点下一页就页面无法打开了

<%
dim totalPut
dim CurrentPage
dim TotalPages
dim MaxPerPage
MaxPerPage=20
dim connect
set connect=server.CreateObject ("adodb.connection")
connect.Open MM_conn_STRING
dim rs
set rs=server.CreateObject ("adodb.recordset")
dim name,institue,specialty
name = request.querystring("textname")
institue = request.querystring("textinstitue")
specialty = request.querystring("textspecialty")
sql = "select name,institue,specialty from new_infor_student"

select case name
case "" sql=sql & " WHERE"
case else sql=sql & " WHERE name like '%"&name&"%' and"
end select

if institue<>"" then
sql=sql & " institue='"&institue&"'"
end if

if specialty <>"" then
sql=sql & " and specialty='"&specialty&"'"
end if
rs.Open sql,connect,1,1
%>
<%
if rs.recordcount=0 then
%>
没有查询记录!

<%
else
totalPut=rs.recordcount
if currentpage<1 then
currentpage=1
end if

if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
showContent
showpage totalput,MaxPerPage,"search.asp"
else
if (currentPage-1)*MaxPerPage rs.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rs.bookmark
showContent
showpage totalput,MaxPerPage,"search.asp"
else
currentPage=1
showContent
showpage totalput,MaxPerPage,"search.asp"
end if
end if
rs.close
end if

sub showContent
dim i
i=0
%>







<%do until rs.EOF%>








<%
i=i+1
if i>=MaxPerPage then exit do
rs.movenext
loop
%>
姓名专业学院
<%=rs("name")%> <%=rs("specialty")%> <%=rs("institue")%>

<%
end sub
%>
未完待续
<%if n-currentpage<1 then
response.write "下一页 尾页"
else
response.write ""
response.write "下一页 尾页"
end if
response.write " 页次:"&CurrentPage&"/"&n&"页 "
response.write " "&maxperpage&"条记录/页 "

end function
%>
下面传了一个搭答page值走.但是页面没有request过来.
在上面加一个
<%page=Request("谈绝page")%>
应该就可以了含枝姿.
你的超链接跳到哪去了
超链接地址错了
页面还是要跳转回本页的
没有获取到页面名吧
← 上一篇: 下一篇: →