分页显示多张图片
来源:互联网 发布:linux yum jdk1.7 编辑:程序博客网 时间:2024/04/28 08:36
<!--#include file="conn.asp"-->
<html xmlns="http://www.w3.org/1999/xhtml">
<body>
<%
dim str,rs
str="select * from pic order by id desc"
set rs=server.CreateObject("ADODB.Recordset")
rs.open str,db,1
if not rs.bof and not rs.eof then
Dim totalPut,CurrentPage
rs.PageSize=16
rs.MoveFirst
howmanyfields=rs.Fields.Count-1
If trim(Request("Page"))<>"" then
CurrentPage= CLng(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!</p>"
else
totalPut=rs.recordcount '显示总记录数
if CurrentPage<>1 then
if (currentPage-1)*rs.pagesize<totalPut then
rs.move(currentPage-1)*rs.pagesize
dim bookmark
bookmark=rs.bookmark '返回书签
end if
end if
dim t
t=rs.PageSize/4
Do While Not rs.Eof And t>0
t=t-1
%>
<TABLE border=0 align=center>
<tr>
<%
for i=1 to 4
If Not rs.Bof And Not rs.Eof Then
%>
<TD><B><a href="photo_intro.asp?id=<%=rs("id")%>"><img src="<%=rs("pic")%>" width="200" height="150" border="0"/></a></B></TD>
<%
else
exit for
end if
rs.MoveNext
next
%></tr>
</TABLE>
<%
loop
end if
dim n,k
if (totalPut mod rs.pagesize)=0 then
n= totalPut /rs.pagesize
else
n= totalPut / rs.pagesize+1
end if
%>
<P align="center" class="STYLE2">第<%=currentpage%>页 共<%=n%>页 共<%=rs.recordcount%>条纪录
<% k=currentPage
if k<>1 then
response.write "[<b>"+"<a href='photo.asp?page=1'>首页</a></b>] "
response.write "[<b>"+"<a href='photo.asp?page="+cstr(k-1)+"'>上一页</a></b>] "
else
Response.Write "[首页] [上一页]"
end if
if k<>n then
response.write "[<b>"+"<a href='photo.asp?page="+cstr(k+1)+"'>下一页</a></b>] "
response.write "[<b>"+"<a href='photo.asp?page="+cstr(n)+"'>尾页</a></b>] "
else
Response.Write "[下一页] [尾页]"
end if
Response.Write "[<a href='index.asp' target='_parent'>返回主页</a>]"
%>
</P>
<span class="STYLE2">
<%
end if
rs.close
set rs=nothing
%>
</span>
</body>
</html>
- 分页显示多张图片
- 【ASP】多张图片分页显示
- 显示多张图片
- js显示多张图片
- UIScrollView利用分页展示多张图片
- js显示多张图片的问题
- OpenCV一个窗口显示多张图片
- Gridview显示多张网络图片
- 多张图片并列显示的问题
- 使用GridView表格显示多张图片
- OpenCV一个窗口显示多张图片
- OpenCV一个窗口显示多张图片
- 使用dialogfragment显示多张图片
- 关于S3C2440的LCD只能显示2张图片,不能显示多张图片的问题
- 多张图片合成一张,显示时只显示一张,只显示图片中的一部分
- 如何利用opencv在一个窗口显示多张图片
- 使用LevelListDrawable实现Html.fromHtml多张图片显示
- 使用LevelListDrawable实现Html.fromHtml多张图片显示
- oracle数据库的启动和关闭
- Qt4 for Redhat linux9
- servlet的运行原理
- C# Programming Tips(1) : anonymous methods and delegate
- SQL Server 顯示行號的方法:
- 分页显示多张图片
- 发帖网址
- const 和 static readonly 区别?
- ERP 的价值
- js将来页面保存成文件
- 升級 tar 修正出現 pax_global_header 的訊息
- [体验]用逐浪CMS整合动网论坛的轻便之旅
- 《平凡的世界》经典语句
- 实施CMMI L3所遇问题总结