ASP实现分页显示图片(每页4行,每行3个图片),可以自动分页,首页、下一页、上一页、末页。根据现有代码改 10
</table><%sqltext="selectid,title,picname,bodyfromdanweiwherepid="&id&"andppid=9anden...
</table>
<%sqltext="select id,title,picname,body from danwei where pid="&id&" and ppid=9 and enable=1 order by pl"
rs.Open sqltext,cn,1,1
do while not rs.EOF
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%if trim(rs("picname"))<>"" then%>
<%if right(trim(rs("picname")),3)<>"swf" then%>
<td width="33%" align="center" valign="middle"><a href="products_display.asp?id=<%=rs("id")%>"><img src="upfile/<%=trim(rs("picname"))%>" border=1 /></a></td>
<td width="33%" align="center" valign="middle"><a href="products_display.asp?id=<%=rs("id")%>"></a></td>
<td width="33%" align="center" valign="middle"><a href="products_display.asp?id=<%=rs("id")%>"></a></td>
<%else%>
<%end if%>
<%end if%>
</tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<%rs.MoveNext
loop
rs.Close
%>
</td>
<td bgcolor="#cc9933" valign="top" align="center" width="170"><img name="" src="images/nav2_bg3.gif" width="170" height="32" alt="" />
<table width="170" height="102" border="0" cellpadding="0" cellspacing="0">
<tr></tr>
</table>
<%sqltext="select id,title from classes where pid=9 and enable=1 order by pl"
rs.Open sqltext,cn,1,1
do while not rs.EOF
if id=rs("id") then
%>
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/news/nav_over_brown.gif"><a href="products.asp?id=<%=rs("id")%>" class="link2"><font color="#996600"><%=trim(rs("title"))%></font></a></td>
</tr>
<tr>
<td height="1"></td>
</tr>
</table>
<%else%>
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/news/nav_out_brown.gif"><a href="products.asp?id=<%=rs("id")%>" class="link2"><%=trim(rs("title"))%></a></td>
</tr>
<tr>
<td height="1"></td>
</tr>
</table>
<%end if%>
<%rs.MoveNext
loop
rs.Close
%> 展开
<%sqltext="select id,title,picname,body from danwei where pid="&id&" and ppid=9 and enable=1 order by pl"
rs.Open sqltext,cn,1,1
do while not rs.EOF
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<%if trim(rs("picname"))<>"" then%>
<%if right(trim(rs("picname")),3)<>"swf" then%>
<td width="33%" align="center" valign="middle"><a href="products_display.asp?id=<%=rs("id")%>"><img src="upfile/<%=trim(rs("picname"))%>" border=1 /></a></td>
<td width="33%" align="center" valign="middle"><a href="products_display.asp?id=<%=rs("id")%>"></a></td>
<td width="33%" align="center" valign="middle"><a href="products_display.asp?id=<%=rs("id")%>"></a></td>
<%else%>
<%end if%>
<%end if%>
</tr>
</table>
<table width="96%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td> </td>
</tr>
</table>
<%rs.MoveNext
loop
rs.Close
%>
</td>
<td bgcolor="#cc9933" valign="top" align="center" width="170"><img name="" src="images/nav2_bg3.gif" width="170" height="32" alt="" />
<table width="170" height="102" border="0" cellpadding="0" cellspacing="0">
<tr></tr>
</table>
<%sqltext="select id,title from classes where pid=9 and enable=1 order by pl"
rs.Open sqltext,cn,1,1
do while not rs.EOF
if id=rs("id") then
%>
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/news/nav_over_brown.gif"><a href="products.asp?id=<%=rs("id")%>" class="link2"><font color="#996600"><%=trim(rs("title"))%></font></a></td>
</tr>
<tr>
<td height="1"></td>
</tr>
</table>
<%else%>
<table width="170" border="0" cellspacing="0" cellpadding="0">
<tr>
<td background="images/news/nav_out_brown.gif"><a href="products.asp?id=<%=rs("id")%>" class="link2"><%=trim(rs("title"))%></a></td>
</tr>
<tr>
<td height="1"></td>
</tr>
</table>
<%end if%>
<%rs.MoveNext
loop
rs.Close
%> 展开
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询