200分速征完善的分页代码
要求 每页显示12条,3行 4列的显示方式
分页要求 1 2 3 4 5 6 7 8 9 10 前10 后10 首页 尾页
拜谢先~
------解决方案--------------------http://sosuo8.com/article/show.asp?id=162
------解决方案-------------------- <%‘假设记录总数为nCount,总页数为nPageCount
pageNow = request( "pageWill ") 'pageNow为当前页号,pageWill为申请的页号
if pageNow = " " or pageNow > nPageCount then
pageNow = 1
end if
n = (pageNow - 1) * 12 + 1 '计算当前页第一条记录号
'--------------------------
'这里实现移动到记录位置
'--------------------------
for i = 0 to 2
for j = 0 to 3
'---------------------
'检测是否存在该记录,没有则跳出外循环,即A处
'显示记录
'移动到下一条记录
'---------------------
next
response.write " <br> "
next
'位置A:
page1 = (pageNow-1) mod 10 + 1 '计算没邻近页的第一页
for i = 1 to 10
if page1 > nPageCount then
%>
<a href = "?pageWill= <%=page1%> "> <%=page1%> </a>
------解决方案-------------------- <%
Function showpage(page,t_page,t_info)
Dim totlepage,totleinfo,showsize,startpage,endpage,strpage,i
showsize=10
page=CInt(page)
totlepage=t_page
totleinfo=t_info
showsize=10
If Request.Form( "page ") <> " " Then '没有起到过滤作用
page=Request.Form( "page ")
If page> totlepage Then
page=totlepage
End If
End If '没有起到过滤作用
If page <=1 Then
page=1
End If
If totlepage <showsize Then
startpage=1
endpage=totlepage
Else
startpage=page-(page Mod showsize)+1 '十没有包含问题1
endpage=page-(page Mod showsize)+10 '到整数页后前一页无法用
End If
If endpage> =totlepage Then
endpage=totlepage
End If
strpage=strpage& " <table width= " "100% " " height= " "25 " " border= " "0 " " cellpadding= " "0 " " cellspacing= " "0 " "> "
strpage=strpage& " <form method= " "get " " action= " "? " " onSubmit= " "return test(this); " "> "
strpage=strpage& " <tr> <td align= " "left " " valign= " "middle " "> "
strpage=strpage& "[ "
If page <> 1 Then
strpage=strpage& " <a href= " "?page=1 " "> 首页 </a> "
Else
strpage=strpage& "首页   "
End If
If page-10> =0 Then
strpage=strpage& " <a href= " "?page= "&(startpage-10)& " " "> 前十页 </a> "
Else
strpage=strpage& "前十页 "
End If
If page-1> 0 Then
strpage=strpage& " <a href= " "?page= "&(page-1)& " " "> 上一页 </a> "
Else
strpage=strpage& "前一页 "
End If
For i=startpage To endpage
If i <> page Then
strpage=strpage& " <a href= " "?Page= "&i& &q