ASP翻页的实现方法
类别: ASP教程
sub showpages()
dim n
if totalAnnounce mod maxannounce=0 then
n= totalAnnounce maxannounce
else
n= totalAnnounce maxannounce+1
end if
dim k
for k=1 to n
if k=currentPage then
if k=1 then
response.write "<td align=\'center\'><a href=\'list.asp?BoardID="+cstr(bo
ardID)+"&page="+cstr(k+1)+"\'><img src=\'images/down.gif\' border=\'0\'>></td>"
else
if k=n then
response.write "<td align=\'center\'><a href=\'list.asp?BoardID="+cstr(bo
ardID)+"&page="+cstr(k-1)+"\'><img src=\'images/up.gif\' border=\'0\'><
/td>"
else
response.write "<td><a href=\'list.asp?BoardID="+cstr(boardID)+"&page="
+cstr(k-1)+"\'><img src=\'images/up.gif\' border=\'0\'></td>"
response.write "<td><a href=\'list.asp?BoardID="+cstr(boardID)+"&page="
+cstr(k+1)+"\'><img src=\'images/down.gif\' border=\'0\'></td>"
end if
end if
end if
next
response.write "<br>"
end sub
dim n
if totalAnnounce mod maxannounce=0 then
n= totalAnnounce maxannounce
else
n= totalAnnounce maxannounce+1
end if
dim k
for k=1 to n
if k=currentPage then
if k=1 then
response.write "<td align=\'center\'><a href=\'list.asp?BoardID="+cstr(bo
ardID)+"&page="+cstr(k+1)+"\'><img src=\'images/down.gif\' border=\'0\'>></td>"
else
if k=n then
response.write "<td align=\'center\'><a href=\'list.asp?BoardID="+cstr(bo
ardID)+"&page="+cstr(k-1)+"\'><img src=\'images/up.gif\' border=\'0\'><
/td>"
else
response.write "<td><a href=\'list.asp?BoardID="+cstr(boardID)+"&page="
+cstr(k-1)+"\'><img src=\'images/up.gif\' border=\'0\'></td>"
response.write "<td><a href=\'list.asp?BoardID="+cstr(boardID)+"&page="
+cstr(k+1)+"\'><img src=\'images/down.gif\' border=\'0\'></td>"
end if
end if
end if
next
response.write "<br>"
end sub
- 上一篇: 打印出全部服务器变量的方法
- 下一篇: 获得ASP的中文日期字符串
-= 资 源 教 程 =-
文 章 搜 索