ASP 数字分页效果代码(4)


lb=lb&"<a href=""/list/list_"&theid&"_"&i&".htm"">"&i&"</a>"
end if
next

完整代码:

复制代码 代码如下:

pageno=cint(currentPage)
if cint(pageno)>1 then
lb=lb&"<a href=/list/list_"&theid&"_1.htm title=""首页"">首页</a>"
else
lb=lb&"<a href='#'>首页</a>"
end if
if cint(pageno)>1 and cint(pageno) then
lb=lb&"<a href=/list/list_"&theid&"_"&pageno-1&".htm title=""上页"">上页</a>"
else
lb=lb&"<a href='#'>上页</a>"
end if
ps=cint(pageno)-2           
  if ps<1 then           
  ps=1           
  end if
pe=clng(pageno)+5
if pe>mpage then pe=mpage
for i=ps to pe
if i=pageno then
lb=lb&"<strong>"&i&"</strong>"
else
lb=lb&"<a href=""/list/list_"&theid&"_"&i&".htm"">"&i&"</a>"
end if
next

if cint(pageno)<mpage and mpage>1 then
lb=lb&"<a href=/list/list_"&theid&"_"&pageno+1&".htm title=""下页"">下页</a>"
else
lb=lb&"<a href='#'>下页</a>"
end if
if cint(pageno)< mpage then
lb=lb&"<a href=/list/list_"&theid&"_"&mpage&".htm title=""末页"">末页</a>"
end if