📄 navigate.asp
字号:
<%
Function GetNavigate(sFileName,iRecordCount,iMaxPageCount,iiCurrentPageIndexIndex,blShowRecordCount,blShowPageSize,sUnit)
dim n, i,sTmp,sUrl
if iRecordCount mod iMaxPageCount=0 then
n= iRecordCount \ iMaxPageCount
else
n= iRecordCount \ iMaxPageCount+1
end if
sUrl=JoinChar(sFileName)
sTmp= "<table align='center' class=f9><form name='Navigate' method='Get' action='" & sFileName & "'><tr><td class='t1'>"
if blShowRecordCount=true then
sTmp=sTmp & "共" & iRecordCount & sUnit & " "
end if
sTmp=sTmp & " " & iMaxPageCount & "" & sUnit & "/页"
sTmp=sTmp & " 当前:<font color=red>" & iCurrentPageIndex & "</font>/" & n & "页 "
if iCurrentPageIndex<2 then
sTmp=sTmp & "首页 上一页 "
else
sTmp=sTmp & "<a href='" & sUrl & "page=1'>首页</a> "
sTmp=sTmp & "<a href='" & sUrl & "page=" & (iCurrentPageIndex-1) & "'>上一页</a> "
end if
if n-iCurrentPageIndex<1 then
sTmp=sTmp & "下一页 尾页"
else
sTmp=sTmp & "<a href='" & sUrl & "page=" & (iCurrentPageIndex+1) & "'>下一页</a> "
sTmp=sTmp & "<a href='" & sUrl & "page=" & n & "'>尾页</a>"
end if
sTmp=sTmp & "</td></tr></form></table>"
GetNavigate=sTmp
End Function
function JoinChar(sUrl)
if sUrl="" then
JoinChar=""
exit function
end if
if InStr(sUrl,"?")<len(sUrl) then
if InStr(sUrl,"?")>1 then
if InStr(sUrl,"&")<len(sUrl) then
JoinChar=sUrl & "&"
else
JoinChar=sUrl
end if
else
JoinChar=sUrl & "?"
end if
else
JoinChar=sUrl
end if
end function
Sub GetCurrentPageIndex() '取得当前页码
if Request.QueryString("page")<>"" then
iCurrentPageIndex=Cint(trim(Request.QueryString("page")))
if iCurrentPageIndex<1 then iCurrentPageIndex=1
else
iCurrentPageIndex=1
End if
End Sub
%>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -