asp分页(自己整理的2个分页程序)(3)
<td width="36%" bgcolor="#FFFFFF" class="STYLE1"><%=mrs("pass")%></td>
</tr><%
mRs.movenext
If mRs.eof then exit for
next
mRs.close
Set mRs=nothing
%>
<tr>
<td colspan="2" bgcolor="#CCCCCC">
<span class="STYLE1">
<%
call PageControl(iCount,maxpage,page)
Sub PageControl(iCount,pagecount,page)
'生成上一页下一页链接
Dim query, a, x, temp
action = "http://" & Request.ServerVariables("HTTP_HOST") & Request.ServerVariables("SCRIPT_NAME")
query = Split(Request.ServerVariables("QUERY_STRING"), "&")
For Each x In query
a = Split(x, "=")
If StrComp(a(0), "page", vbTextCompare) <> 0 Then
temp = temp & a(0) & "=" & a(1) & "&"
End If
Next
Response.Write("<table border='0' cellpadding='3' style='border-collapse: collapse' width='100%' align='center'>")
Response.Write("<form method=get onsubmit=""document.location = '" & action & "?" & temp & "Page='+ this.page.value;return false;""><tr>")
Response.Write("<td align='center' bgcolor='#FFFFFF'>")
If page<=1 then
Response.Write ("首页 " )
Response.Write ("上一页 ")
Else
Response.Write("<a href=" & action & "?" & temp & "Page=1>首页</a> ")
Response.Write("<a href=" & action & "?" & temp & "Page=" & (Page-1) & ">上一页</a> ")
End If
If page>=pagecount then
Response.Write ("下一页 ")
Response.Write ("尾页 ")
Else
内容版权声明:除非注明,否则皆为本站原创文章。