'TarUrl=要分页显示的文件名称
'TotalNum=总记录条数
'PageNum=每页显示条数
'Page=页码
'ShowTotal=是否显示总页次
'ShowList=是否显示下拉页码
'Unit=单位
Sub ShowPage(TarUrl,TotalNum,PageNum,Page,ShowTotal,ShowList,Unit)
Dim p,TotalPage,strTemp,strUrl
If TotalNum mod PageNum =0 Then
TotalPage = TotalNum \ PageNum 'totalpage=分出来多少页,的页数
Else
TotalPage = TotalNum \ PageNum+1
End If
response.write("<form name='form1' method='get' action='"&TarUrl&"'><tr><td>")
if ShowTotal=true then
response.write("共<b>"&TotalNum&"</b>"&Unit&" ")
end if
response.write("首页 上一页 ")
else
response.write("<a href="&TarUrl&"?page=1>首页</a> ")
response.write("<a href="&TarUrl&"?page="&page-1&">上一页</a> ")
end if
if TotalPage-Page<1 then
response.write(" 下一页 尾页")
else
response.write("<a href='"&TarUrl&"?page="&page+1&"'>下一页</a> ")
response.write("<a href='"&TarUrl&"?page="&TotalPage&"'>尾页</a>")
end if
response.write(" 页次:"&Page&"/"&TotalPage&" 每页 "&PageNum&" "&Unit)
if ShowList=true then
response.write(" 转到:<select name='page' id='page' onChange='javascript:submit()'>")
for p=1 to TotalPage
response.write("<option value='"&p&"'" )
if cint(page)=cint(p) then response.write("selected")
response.write(">第"&p&"页</option>")
next
response.write("</select>")
end if
response.write("</td></tr></form></table>")
End sub
%>
'TarUrl=要分页显示的文件名称
'TotalNum=总记录条数
'PageNum=每页显示条数
'Page=页码
'ShowTotal=是否显示总页次
'ShowList=是否显示下拉页码
'Unit=单位
Sub ShowPage(TarUrl,TotalNum,PageNum,Page,ShowTotal,ShowList,Unit)
Dim p,TotalPage,strTemp,strUrl
If TotalNum mod PageNum =0 Then
TotalPage = TotalNum \ PageNum 'totalpage=分出来多少页,的页数
Else
TotalPage = TotalNum \ PageNum+1
End If
response.write("<form name='form1' method='get' action='"&TarUrl&"'><tr><td>")
if ShowTotal=true then
response.write("共<b>"&TotalNum&"</b>"&Unit&" ")
end if
response.write("首页 上一页 ")
else
response.write("<a href="&TarUrl&"?page=1>首页</a> ")
response.write("<a href="&TarUrl&"?page="&page-1&">上一页</a> ")
end if
if TotalPage-Page<1 then
response.write(" 下一页 尾页")
else
response.write("<a href='"&TarUrl&"?page="&page+1&"'>下一页</a> ")
response.write("<a href='"&TarUrl&"?page="&TotalPage&"'>尾页</a>")
end if
response.write(" 页次:"&Page&"/"&TotalPage&" 每页 "&PageNum&" "&Unit)
if ShowList=true then
response.write(" 转到:<select name='page' id='page' onChange='javascript:submit()'>")
for p=1 to TotalPage
response.write("<option value='"&p&"'" )
if cint(page)=cint(p) then response.write("selected")
response.write(">第"&p&"页</option>")
next
response.write("</select>")
end if
response.write("</td></tr></form></table>")
End sub
%>