⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 turnpage.asp

📁 学校勤工助学管理网站 功能可管理 考勤计算工资并进行等级评估。
💻 ASP
字号:
<%
'+++++++++++++++++++++++++++++++++++++
'◆模块名称: 公共翻页模块
'◆文 件 名: TurnPage.asp
'◆传入参数: Rs_tmp (记录集), PageSize (每页显示的记录条数)
'◆输    出: 记录集翻页显示功能
'+++++++++++++++++++++++++++++++++++++
'
Sub TurnPage(ByRef Rs_tmp, ByRef 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 border=0  width=600>  
 <tr> 
  <td align=left> Total :<font color=#ff3333><%=TotalPage%></font>Pages
      &nbsp;&nbsp;now<font color=#ff3333><%=PageNo%></font>page</td>
  <td align="right"  width=200> 
   <%If RecordCount = 0 or TotalPage = 1 Then 
        Response.Write "first|before|back|last"
     Else%>
        <a href="<%=fileName%>?PageNo=1">First|</a>
        
  <%If PageNo - 1 = 0 Then
      Response.Write "Before|"
   Else%>
  <a href="<%=fileName%>?PageNo=<%=PageNo-1%>">Before|</a>
  <%End If
     If PageNo+1 > TotalPage Then
         Response.Write "Back|"
   Else%>
      <a href="<%=fileName%>?PageNo=<%=PageNo+1%>">Next|</a>
  <%End If%>
  
     <a href="<%=fileName%>?PageNo=<%=TotalPage%>">Last</a>
   <%End If%></td>
   
   <td width=200>Turn to
   <%If TotalPage = 1 Then%>
        <input type=text name=PageNo size=3 readonly disabled style="background:#d3d3d3">
   <%Else%>
        <input type=text name=PageNo size=3 value=""  title=请输入页号,然后回车>
        <%End If%>   </td>
  </tr>
</table>
<%End Sub%>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -