这样的分页代码怎么写?

salam2011 2011-06-28 09:29:49
...全文
107 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
ASP拾荒者 2011-07-06
  • 打赏
  • 举报
回复
yekang10 2011-07-04
  • 打赏
  • 举报
回复
在asp.net中的gridview中有就有给你个gridview中的用法http://blog.csdn.net/21aspnet/article/details/1540301
lkh930303 2011-07-04
  • 打赏
  • 举报
回复
gridview里有分页功能
salam2011 2011-06-29
  • 打赏
  • 举报
回复
[Quote=引用 4 楼 beyond_me21 的回复:]
HTML code

function pagecute(maxpage,thepages,viewpage,pageurl,pp)
pagecute="&nbsp;<div style='float:left; heigth:17px; padding-left:15px; padding-right:30px; padding-top:1px; '>"&Common_……
[/Quote]

要是能再完整点就好了,链接读取数据库代码
beyond_me21 2011-06-28
  • 打赏
  • 举报
回复

function pagecute(maxpage,thepages,viewpage,pageurl,pp)
pagecute=" <div style='float:left; heigth:17px; padding-left:15px; padding-right:30px; padding-top:1px; '>"&Common_Dict("页次")&":<font class='Yellow'>"&viewpage&"</font> of <font class='Yellow'>"&thepages&"</font> </div>"
if int(thepages)=0 then
pagecute=pagecute&"<div class='page_cute'>1</div><div class=""c""></div><br><br>"
exit function
end if
dim pn,pi,page_num,ppp,pl,pr
pi=1
ppp=pp\2
if pp mod 2 = 0 then ppp=ppp-1
pl=viewpage-ppp
pr=pl+pp-1
if pl<1 then
pr=pr-pl+1
pl=1
if pr>thepages then pr=thepages
end if
if pr>int(thepages) then
pl=pl+thepages-pr
pr=thepages
if pl<1 then pl=1
end if
if pl>1 then
pagecute=pagecute&" <div class='page_cute'><a href='"& pageurl &"' title='The first page'><font face=""webdings"">9</font></a></div> " & _
" <div class='page_cute'><a href='"& pageurl &"page="&pl-1&"' title='Previous page'><font face=""webdings"">7</font></a></div> "
end if
for pi=pl to pr
if cint(viewpage)=cint(pi) then
pagecute=pagecute&" <div class='page_cute'>" & pi & "</div> "
else
pagecute=pagecute&" <div class='page_cute'><a href='"& pageurl &"page="& pi &"' title='Page " & pi & "' >" & pi & "</a></div> "
end if
next
if pr<thepages then
pagecute=pagecute&" <div class='page_cute'><a href='"& pageurl &"page="&pi&"' title='Next page'><font face=""webdings"">8</font></a></div> " & _
" <div class='page_cute'><a href='"& pageurl &"page="& thepages &"' title='The last page'><font face=""webdings"">:</font></a></div> "

end if
pagecute=pagecute&"<div class=""c""></div><br><br>"
end function
挨踢直男 2011-06-28
  • 打赏
  • 举报
回复
那只是个分页的html显示样式。。。你是需要分页程序?
salam2011 2011-06-28
  • 打赏
  • 举报
回复
[Quote=引用 1 楼 aspwebchh 的回复:]
分页
[/Quote]

楼上这个是怎样读取数据库的?
挨踢直男 2011-06-28
  • 打赏
  • 举报
回复

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧