28,406
社区成员
发帖
与我相关
我的任务
分享
<%
Sub TurnPage(ByRef Rs_tmp,PageSize) //Rs_tmp 记录集 ; PageSize 每页显示的记录条数;
Dim TotalPage //总页数
Dim PageNo //当前显示的是第几页
Dim RecordCount //总记录条数
Rs_tmp.PageSize = PageSize
RecordCount = Rs_tmp.RecordCount
TotalPage = INT(RecordCount / PageSize * -1)*-1
PageNo = Request.QueryString ("PageNo")
//直接输入页数跳转,这里被我注释掉了;
//If Request.Form("PageNo")<>"" Then PageNo = Request.Form("PageNo")
//如果没有选择第几页,则默认显示第一页;
If PageNo = "" then PageNo = 1
If RecordCount <> 0 then
Rs_tmp.AbsolutePage = PageNo
End If
//获取当前文件名,使得每次翻页都在当前页面进行;
Dim fileName,postion
fileName = Request.ServerVariables("script_name")
postion = InstrRev(fileName,"/")+1
//取得当前的文件名称,使翻页的链接指向当前文件;
fileName = Mid(fileName,postion)
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="STYLE4"> 共有 <%=RecordCount%>条记录,当前第 <%=PageNo%>/<%=TotalPage%>页</td>
<td><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="40">
<%
If RecordCount = 0 or TotalPage = 1 Then
Else
%>
<a href="<%=fileName%>?PageNo=1"><img src="../images/first.gif" width="37" height="15" border="0" /></a></td>
<td width="45">
<%If PageNo - 1 = 0 Then
Else
%>
<a href="<%=fileName%>?PageNo=<%=PageNo-1%>"><img src="../images/pageup.gif" width="43" height="15" border="0" /></a></td>
<td width="45">
<%
End If
If PageNo+1 > TotalPage Then
Else
%>
<a href="<%=fileName%>?PageNo=<%=PageNo+1%>"><img src="../images/next.gif" width="43" height="15" border="0" /></a></td>
<td width="40">
<%End If%>
<a href="<%=fileName%>?PageNo=<%=TotalPage%>"><img src="../images/last.gif" width="37" height="15" border="0" /></a></td>
<%End If%>
<td width="120"><div align="center"><span class="STYLE1">转到第
<%
If TotalPage = 1 Then
%>
<input type=text name=PageNo size=3 readonly disabled style="background:#d3d3d3">
<%Else%>
<input name=PageNo type="text" size="4" style="height:12px; width:20px; border:1px solid #999999;" title=请输入页号,然后回车>//在这里输入页面数字点击下面这个超链图片跳转
<%End If%>页</span><a href="<%=fileName%>?PageNo=<%=PageNo%>"><img src="../images/go.gif" width="37" height="15" border="0" /></a></div></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%End Sub%>
<%
Sub TurnPage(ByRef Rs_tmp,PageSize) //Rs_tmp 记录集 ; PageSize 每页显示的记录条数;
Dim TotalPage //总页数
Dim PageNo //当前显示的是第几页
Dim RecordCount //总记录条数
Rs_tmp.PageSize = PageSize
RecordCount = Rs_tmp.RecordCount
TotalPage = INT(RecordCount / PageSize * -1)*-1
PageNo = Request.QueryString ("PageNo")
//直接输入页数跳转,这里被我注释掉了;
//If Request.Form("PageNo")<>"" Then PageNo = Request.Form("PageNo")
//如果没有选择第几页,则默认显示第一页;
If PageNo = "" then PageNo = 1
If RecordCount <> 0 then
Rs_tmp.AbsolutePage = PageNo
End If
//获取当前文件名,使得每次翻页都在当前页面进行;
Dim fileName,postion
fileName = Request.ServerVariables("script_name")
postion = InstrRev(fileName,"/")+1
//取得当前的文件名称,使翻页的链接指向当前文件;
fileName = Mid(fileName,postion)
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="STYLE4"> 共有 <%=RecordCount%>条记录,当前第 <%=PageNo%>/<%=TotalPage%>页</td>
<td><table border="0" align="right" cellpadding="0" cellspacing="0">
<tr>
<td width="40">
<%
If RecordCount = 0 or TotalPage = 1 Then
Else
%>
<a href="<%=fileName%>?PageNo=1"><img src="../images/first.gif" width="37" height="15" border="0" /></a></td>
<td width="45">
<%If PageNo - 1 = 0 Then
Else
%>
<a href="<%=fileName%>?PageNo=<%=PageNo-1%>"><img src="../images/pageup.gif" width="43" height="15" border="0" /></a></td>
<td width="45">
<%
End If
If PageNo+1 > TotalPage Then
Else
%>
<a href="<%=fileName%>?PageNo=<%=PageNo+1%>"><img src="../images/next.gif" width="43" height="15" border="0" /></a></td>
<td width="40">
<%End If%>
<a href="<%=fileName%>?PageNo=<%=TotalPage%>"><img src="../images/last.gif" width="37" height="15" border="0" /></a></td>
<%End If%>
<td width="120"><form id="form1" name="form1" method="get" action="<%=fileName%>">
<div align="center">
<span class="STYLE1">转到第
<%
If TotalPage = 1 Then
%>
<input type=text name=PageNo size=3 readonly disabled style="background:#d3d3d3">
<%Else%>
<input name=PageNo type="text" size="4" style="height:12px; width:20px; border:1px solid #999999;" title=请输入页号,然后回车>//在这里输入页面数字点击下面这个超链图片跳转
<%End If%>页</span><a href="<%=fileName%>?PageNo=<%=PageNo%>"><img src="../images/go.gif" width="37" height="15" border="0" /></a></div>
</form>
</td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
<%End Sub%>