asp图片展示横重复加分页代码!谢谢!!!

横重复加分页代码... 横重复加分页代码 展开
 我来答
appcxy
2007-09-07 · 超过37用户采纳过TA的回答
知道小有建树答主
回答量:119
采纳率:0%
帮助的人:0
展开全部
<%
P_id=request("p_id")
Keyword=request("keyword")
set rs=server.createobject("adodb.recordset")
if keyword="" then
if p_id="" then
rs.open "select * from manage_pro order by id desc",conn,1,1
else
rs.open "select * from manage_pro where p_id="&p_id&" order by id desc",conn,1,1
end if
else
if p_id="" then
rs.open "select * from manage_pro where title like '%"&keyword&"%' order by id desc",conn,1,1
else
rs.open "select * from manage_pro where p_id="&p_id&" and title like '%"&keyword&"%' order by id desc",conn,1,1
end if
end if
dim page
rs.pagesize=12
page=request.querystring("page")
if page = "" or IsNull(page) then page = 1
if not IsNumeric(page) then page = 1
if request("page")<>"" then
page=cint(request("page"))
end if
if page < 1 then
page = 1
elseif page > rs.pagecount then
page = rs.pagecount
end if
if not rs.EOF and not rs.bof then
rs.absolutepage=page
end if
count=rs.pagesize
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title></title>
<link href="Css.css" rel="stylesheet" type="text/css">
</head>
<body>
<table width="1002" border="0" align="center" cellpadding="0" cellspacing="0">
<tr align="center" valign="top">
<td width="201" background="images/image_r5_c1.jpg">
</td>
<td width="801" background="Images/R_menu_bg.jpg"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><img name="image_r4_c4" src="Images/R_menu_2.jpg" width="801" height="38" border="0" id="image_r4_c4" alt="" /></td>
</tr>
</table>
<%if p_id<>"" and keyword="" then%>
<table width="92%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="1"></td>
</tr>
<tr>
<td height="30"><strong style="font-size:14px"><a href="Products.asp">[产品中心]</a></strong>
<%if p_id<>"" then%>

<span class="ja" style="font-size:14px">-></span>
<%
set lb=server.CreateObject("adodb.recordset")
lb.open "select * from manage_p where p_id="&p_id,conn,1,1
response.write "<a href='Products.asp?P_id="&lb("p_id")&"' onfocus='this.blur()'><b style='font-size:14px'>"&lb("p_name")&"</b></a>"
lb.close
set lb=nothing
end if
%></td>
</tr>
</table>
<%elseif keyword<>"" then%>
<table width="92%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30" align="left"><strong style="font-size:14px">关键字:<font color="#FF0000"><%=keyword%></font> 共搜索到 <font color="#FF0000"><%=rs.recordcount%></font> 条记录</strong></td>
</tr>
</table>
<% end if %>
<br>
<table width="92%" border="0" align="center" cellpadding="0" cellspacing="0">
<%if rs.eof then
Response.Write("<font color=red>无记录!</font>")
else
for j=1 to 3
%>
<tr>
<%for i=1 to 4%>
<td align="center" valign="middle"><table width="128" height="132" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td align="center" valign="middle" bgcolor="#FFFFFF"><a href="Show_product.asp?Id=<%=rs("id")%>" target="_blank" onFocus="this.blur()">
<%
if rs("pic")<>"" then
%>
<img src="<%=rs("pic")%>" width="120" height="120" border="0" onload='javascript:DrawImage(this,120,120);'>
<%
else
response.write "暂 无<br><br>图 片"
end if
%>
</a></td>
</tr>
</table>
<table width="145" border="0" cellpadding="0" cellspacing="6" bgcolor="#FFFFFF">
<tr>
<td height="22" align="center" bgcolor="#EFEFEF"><a href="Show_product.asp?Id=<%=rs("id")%>" target="_blank" onFocus="this.blur()">
<%
if keyword="" then
response.write rs("title")
else
response.write replace(rs("title"),keyword,"<b><font color=red>"&keyword&"</font></b>")
end if
%>
</a></td>
</tr>
</table></td>
<%
rs.movenext
if rs.eof then
exit for
end if
next
%>
</tr>
<%
if rs.eof then
exit for
end if
next
end if
%>
</table>
<br>
<table width="92%" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#F3F3F3">
<form action="" method="get" name="myform">
<tr>
<td width="100%" height="25" colspan="3" align="center" valign="middle" class="font">共 <%=rs.recordcount%> 条 <a href="?P_id=<%=p_id%>&page=1">第一页</a>
<%if page>1 then%>
<a href="?P_id=<%=p_id%>&page=<%=page-1%>">上一页</a>
<%else%>
上一页
<%end if%>
<%if page<rs.pagecount then%>
<a href="?P_id=<%=p_id%>&page=<%=page+1%>">下一页</a>
<%else%>
下一页
<%end if%>
<a href="?P_id=<%=p_id%>&page=<%=rs.pagecount%>">尾页</a>    转到:
<%if rs.recordcount<>0 then%>
<select name="page" id="page" onChange="if(this.options[this.selectedIndex].value!=''){location='?P_id=<%=p_id%>&page='+this.options[this.selectedIndex].value;}">
<%for i=1 to rs.pagecount%>
<option value="<%=i%>" <% if cint(page)=cint(i) then %>selected<%end if%>>第<%=i%>页</option>
<%next%>
</select>
<%end if%>
</td>
</tr>
</form>
</table>
<br></td>
</tr>
</table>
</body>
</html>
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式