看胃癌哪个医院比较好:如何在网页里添加分页[1] [2] [3] [4] 。。。分页插入的代码是什么?

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/08 05:00:02

.net的自己的控件就可以了,不用自己写

asp的话要自己写:
<%
MMaxPerPage=16
rs.PageSize=MMaxPerPage

if trim(request("Page"))<>"" then
CurrentPage=CInt(request("Page"))
if CurrentPage>rs.PageCount then
CurrentPage=rs.PageCount
end if
else
CurrentPage=1
end if

'if rs.EOF then
' Response.Write "<p align='center'>ERROR!<BR>No record found!</p>"
'else
ttotalPut=rs.RecordCount
if CurrentPage<>1 then
if (CurrentPage-1)*MMaxPerPage<ttotalPut then
rs.Move(CurrentPage-1)*MMaxPerPage
bookmark=rs.Bookmark
end if
end if
'end if

if (ttotalPut mod MMaxPerPage)=0 then
mm=ttotalPut\MMaxPerPage
else
mm=ttotalPut\MMaxPerPage+1
end if

if (ttotalPut mod (MMaxPerPage*10))=0 then
nn=ttotalPut\(MMaxPerPage*10)
else
nn=ttotalPut\(MMaxPerPage*10)+1
end if

%>
<%
k=0
for y=(page-1)*16+1 to (page-1)*16+16
if not rs.EOF then
if (k mod 2)=0 then
%>

if (CurrentPage mod 10)=0 then
kk=CurrentPage\10-1
else
kk=CurrentPage\10
end if

代码不是很规范,你可以大概参造下

你用的什么语言

其实说白了。就是用一个查询从第几列到第几列的存储过程了。至于实现...楼主查查网上很多的。