代码很简单,很容易看懂。而且可以直接调用。
调用时,把url(你所要插入代码的页面名),imgurl(图片地址),改成自己所要的,就行了。
<%function showpage(url,imgurl)
page=request("page")
PageSize = 20
rs.PageSize = PageSize
totalfilm=rs.recordcount
pgnum=rs.Pagecount
if page="" or clng(page)<1 then page=1
if clng(page) > pgnum then page=pgnum
if pgnum>0 then rs.AbsolutePage=page
response.Write"<form method=Post action='"&url&"' name='go'>"
response.Write" <td align='left'> 共有<font color='#0033CC'>"&rs.recordcount&"</font>条记录"
response.Write"["&page&"/<b>"&rs.pagecount&"</b>页] [共"&totalfilm&"个] "
if page=1 then
response.Write"[首页] [上一页]"
else
response.Write"[<a href='"&url&"?page=1'>首页</a>]"
response.Write"[<a href='"&url&"?page="&page-1&"'>上一页</a>]"
end if
if rs.pagecount-page<1 then
response.Write"[下一页] [尾页]"
else
response.Write"[<a href='"&url&"?page="&page+1&"'>下一页</a>] "
response.Write"[<a href='"&url&"?page="&rs.pagecount&"'>尾页</a>]"
end if
response.Write" </span><input type='text' name='page' size=2 maxlength=10 style='font-size:9pt;color:#FFFFFF;background-color:#B9D9CE;border-left: 1px solid #000000; border-right: 1px solid #000000; border-top: 1px solid #000000; border-bottom: 1px solid #000000' value='"&page&"' align=center>"
response.Write"<img src='"&imgurl&"' border='0' alt='GO'onClick='javascript:document.go.submit()' style='cursor:hand '> "
response.Write"</td>"
response.Write" </form>"
end function%>
[原创]自写的一个简单的分页函数