图片分页代码,asp图片分页代码,asp图片分页源代码及教程
<table width="700" border="1" cellspacing="0" cellpadding="0">
<%
sql="select * from [table] order by time1 desc"
rs.open sql,conn,1,1
if rs.eof then
else
rs.pagesize=4
page=clng(Request("page"))
if page<1 then page=1
if page>rs.pagecount then page=rs.pagecount
rs.AbsolutePage = page
for i=1 to rs.pagesize
if i mod 2=1 then
%>
<tr>
<%
end if
%>
<td height="100" align="center"><img src="<%=rs("pic")%>" /></td>
<%
if i mod 2=0 then
%>
</tr>
<%
end if
%>
<%
rs.movenext
If rs.EOF Then
Exit For
End If
Next
end if
'rs.close
%>
<!--#include file="page.asp"-->
<form name="form1" method="post" action="">
<tr>
<td colspan="2"><%
call fpage("")
%></td>
</tr>
</form>
</table>
图片分页显示页面调用代码.fpage()函数,而分页函数写在下面的页面.
<script language="javascript">
function fp()
{
for (i=0;i<document.form1.page.length;i++)
{
if(document.form1.page.options[i].selected==true)
{
//location.href="?page="+(i+1)+str;
document.form1.action="?page="+(i+1);
document.form1.submit();
break;
}
}
}
function fy(id)
{
document.form1.action="?page="+id;
document.form1.submit();
}
</script>
<%
page=clng(Request("page"))
if page<1 then page=1
Function fpage(str)
s=Split(str,"|")
s2=""
For i=0 To UBound(s)
s2=s2&"<Input type=""hidden"" name="""&s(i)&""" value="""&request(s(i))&""">"
next
response.write "<table width=""100%"" cellpadding=0 cellspacing=0 border=0>"
response.write " <tr>"
response.write " <td align=""left"" width=""95%""> 信息总数:"&rs.recordcount&"个 页次:"&page&"/"&rs.pagecount&"页"
response.write " "&s2
If page<=1 Then
response.write " 首 页 上一页 "
Else
response.write "<a href=""javascript:fy(1);""><font color='#ff0000'>首 页</font></a> <a href=""javascript:fy("&page-1&");""><font color='#ff0000'>上一页</font></a> "
End If
'response.write "rs.pagecount="&rs.pagecount
If page<rs.pagecount Then
response.write "<a href=""javascript:fy("&page+1&");""><font color='#ff0000'>下一页</font></a> <a href=""javascript:fy("&rs.pagecount&");""><font color='#ff0000'>尾 页</font></a>"
Else
response.write "下一页 尾 页 "
End If
response.write " 第 <select name=""page"" onchange=""javascript:fp();"">"
For i=1 To rs.pagecount
response.write "<option value="&i
If CInt(i)=CInt(page) Then
response.write " selected"
End If
response.write ">"&i&"</option>"
Next
response.write "</select> 页"
response.write "</td> "
response.write " <td width=""5%""></td>"
response.write " </tr>"
response.write "</table>"
End Function
%>
这个文件是以page.asp文件保存的.