在线#############我这样分页为什么不能按我要求显示图片呢?

clcy 2005-05-26 02:49:17
<!--#include file="../conn.asp"-->
<html>
<head>
<%
set rs3=server.createobject("adodb.recordset")
sql="select * from cpone"
rs3.open sql,conn,1,3
'/////////////////////////////////////分页 cpone 表数据分页
dim pagenum
rs3.pagesize=9
pagecount1=rs3.pagecount
if request.querystring("pagenum")=0 or request.querystring("pagenum")="" then
pagenum=1
else
pagenum=request.querystring("pagenum")
rs3.absolutepage=trim(request.querystring("pagenum"))
end if
%>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
</head>
<body>
<% do while not rs3.eof and i<=9 %>
<tr>
<% for i=1 to 3 %>

<td height="48" align="center" valign="top"><table width="170" height="169" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="dcdcdc">
<tr>
<td width="158" height="115" background="../gif/003.gif" bgcolor="#FFFFFF"><table width="154" height="109" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td><div align="center"><a onclick="MM_openBrWindow('lcddisplay.asp?xinghao=<%=rs3("xinghao")%>&id=<%=rs3("id")%>','','width=500,height=600')"
href="javascript:;">
<% response.Write "<img src="&trim(rs3("image"))&" width=125 height=100 border=0 >" %>
</a> </div></td>
</tr>
</table></td>
</tr>
<tr>
<td height="54" bgcolor="#FFFFFF"><table width="169" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="23"><p class="style1"> <img src="../gif/dia.gif" width="8" height="9"> 型 号:<%=rs3("xinghao")%></p></td>
</tr>
<tr>
<td height="23"><span class="style1"><img src="../gif/dia.gif" width="8" height="9"> 亮 度:<%=rs3("liangdu")%></span></td>
</tr>
<tr>
<td height="23"><span class="style1"><img src="../gif/dia.gif" width="8" height="9"> 色彩度:<%=rs3("sedu")%></span></td>
</tr>
</table></td>
</tr>
</table></td>
<% if i=3 then exit for
if rs3.eof then exit do
rs3.movenext
if rs3.eof then exit for
if rs3.eof then exit do
next%>
</tr>
<tr>
<td height="13" align="center" valign="top"> </td>
</tr>
<% if rs3.eof then exit do
i=i+1
rs3.movenext
if rs3.eof then exit do
loop

%>
</table> </td>
</tr>
<%

' i=i+1
'rs3.movenext
'loop
'///////////////////////////////////

rs3.close
set rs3=nothing
%>
<tr>
<td background="../gif/bit2.gif"><img src="../gif/bit2.gif" width="3" height="1"></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
<tr>
<td height="30" background="../gif/right.gif" class="style1"><div align="center"><a href=chinaindex.asp?pagenum=1 class="style2"><span class="style4">首页</span></a>
<%if pagenum>1 then%>
<a href=chinaindex.asp?pagenum=<%=(pagenum-1)%>>上一页</a>
<%else%>
上一页
<%end if%>
<%if pagenum < trim(pagecount1) then%>
<a href=chinaindex.asp?pagenum=<%=(pagenum+1)%>>下一页</a>
<%else%>
下一页
<%end if%>
<a href=chinaindex.asp?pagenum=<%=pagecount1%>>尾页</a>
</div></td></tr>
</table></td>
</tr>
<tr>
<td height="13" colspan="2"><!--include file="end.asp"--> </td>
</tr>
</table></td>
</tr>
</table>
</body>
</html>
...全文
94 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
victorhero 2005-05-26
  • 打赏
  • 举报
回复
有什么问题?你想做成什么样的。
clcy 2005-05-26
  • 打赏
  • 举报
回复
OK我试哈
丛林蚂蚁 2005-05-26
  • 打赏
  • 举报
回复
下午太困了.脑袋都大了.没法分析你的文件了.我直接把我的分页代码抄给你吧.

<!--#include file="inc/conn.asp"-->
<%
classid = cint(request("id"))

PageNo=Request("pageno")
if PageNo="" Then
PageNo = 1
end if
if PageNo < 1 Then
PageNo = 1
end if
%>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title><%=ClassName%> - 折扣商城</title>
<link href="style/style.css" rel="stylesheet" type="text/css">
<script language=javascript>
//选择"第?页"时响应:
function PageCurrent()
{
document.pagination.submit();
}
</script>

</head>

<body>

<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber9">
<tr>
<td width="100%" colspan="3" bgcolor="#008ED2" height="26">  <b>
<font color="#FFFFFF"><%=ClassName%> 商品列表</font></b></td>
</tr>
<%
sql = "select M.*,S.ShopName,C.ParentID from MD_Merchandise M,MD_Shop S,MD_Class C where M.Shopid=S.id and M.ClassID=C.id and M.isdel=0 and datediff(d,M.BeginDate,getdate())<=M.DurativeDays and C.id="&classid&" order by M.id desc"
Set RS = Server.CreateObject("ADODB.RecordSet")
rs.open sql,conn,1,3

PgSz=12 '设定开关,指定每一页所显示的帖子数目,默认为20帖一页
RS.PageSize = Cint(PgSz) '设定PageSize属性的值
if RS.RecordCount<>0 then
Total=INT(RS.recordcount / PgSz * -1)*-1 '计算可显示页面的总数
RS.AbsolutePage = PageNo
position=RS.PageSize*PageNo
pagebegin=position-RS.PageSize+1
if position < RS.RecordCount then
pagend=position
else
pagend= RS.RecordCount
end if

RowCount = RS.PageSize
Do While Not RS.EOF and rowcount > 0
%>
<tr>
<td width="100%" colspan="3" height="10"></td>
</tr>
<tr>
<td width="49%">
<%
if not rs.eof then
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber10">
<tr>
<td width="100%" colspan="2" align="left" bgcolor="#EEEEEE" height="22"><div style="overflow: hidden; width: 240; height: 14;"> <a href="show_commodity.asp?id=<%=rs("id")%>" target=_blank title="<%=rs("Merchandise")%>"><b><%=rs("Merchandise")%></b></a></div></td>
</tr>
<tr>
<td width="37%" rowspan="4" align="center">
<a href="show_commodity.asp?id=<%=rs("id")%>" target=_blank>
<%if rs("MerchandisePic")="" then%>
<img border="0" src="images/NoPic.gif" width="65" height="70">
<%else%>
<img border="0" src="<%=rs("MerchandisePic")%>" width="65" height="70">
<%end if%>
</a>
</td>
<td width="63%" height="22"><b>原价:</b><strike>$<%=rs("BeforePrice")%>元</strike></td>
</tr>
<tr>
<td width="63%" height="22"><b>现价:</b><font color=red>$<%=rs("NowPrice")%>元</font></td>
</tr>
<tr>
<td width="63%" height="22"><b>商店:</b><a href="shop.asp?id=<%=rs("shopid")%>"><%=rs("shopname")%></a></td>
</tr>
<tr>
<td width="63%" height="22"><b>有效期:</b><%=rs("beginDate")%>(<%=rs("DurativeDays")%>)</td>
</tr>
</table>
<%
RowCount = RowCount - 1
rs.movenext
end if
%>
</td>
<td width="2%"> </td>
<td width="49%">
<%
if not rs.eof then
%>
<table border="0" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="100%" id="AutoNumber10">
<tr>
<td width="100%" colspan="2" align="left" bgcolor="#EEEEEE" height="22"><div style="overflow: hidden; width: 240; height: 14;"> <a href="show_commodity.asp?id=<%=rs("id")%>" target=_blank title="<%=rs("Merchandise")%>"><b><%=rs("Merchandise")%></b></a></div></td>
</tr>
<tr>
<td width="37%" rowspan="4" align="center">
<a href="show_commodity.asp?id=<%=rs("id")%>" target=_blank>
<%if rs("MerchandisePic")="" then%>
<img border="0" src="images/NoPic.gif" width="65" height="70">
<%else%>
<img border="0" src="<%=rs("MerchandisePic")%>" width="65" height="70">
<%end if%>
</a>
</td>
<td width="63%" height="22"><b>原价:</b><strike>$<%=rs("BeforePrice")%>元</strike></td>
</tr>
<tr>
<td width="63%" height="22"><b>现价:</b><font color=red>$<%=rs("NowPrice")%>元</font></td>
</tr>
<tr>
<td width="63%" height="22"><b>商店:</b><a href="shop.asp?id=<%=rs("shopid")%>"><%=rs("shopname")%></a></td>
</tr>
<tr>
<td width="63%" height="22"><b>有效期:</b><%=rs("beginDate")%>(<%=rs("DurativeDays")%>)</td>
</tr>
</table>
<%
RowCount = RowCount - 1
rs.movenext
end if
%>
</td>
</tr>
<%
loop
%>
<tr>
<td width="100%" colspan="3" height="10"></td>
</tr>
</table>
<%
''创建分页导航
PaginationURL = "class.asp"
response.write "<div align=center>"
response.write "<center>"
response.write "<table border=0 cellpadding=0 cellspacing=0 width='100%'>"
Response.Write("<form method=Post name=pagination action='"&PaginationURL&"?id="&ClassID&"'>")
response.write "<tr>"
response.write "<td width='100%' align=right height=26 bgcolor='#008ED2' class=page>"
if rs.PageCount=1 then
Response.Write("[第一页] [上一页] [下一页] [最后一页] ")
else
if cint(PageNo)=1 then
Response.Write("[第一页] [上一页] ")
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno="&pageno+1&"&id="&Classid&">下一页</a>] ")
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno="&rs.PageCount&"&id="&Classid&">最后一页</a>] ")
else
if cint(PageNo)=cint(rs.PageCount) then
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno=1&id="&Classid&">第一页</a>] ")
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno="&pageno-1&"&id="&Classid&">上一页</a>] ")
Response.Write("[下一页] [最后一页] ")
else
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno=1&id="&Classid&">第一页</a>] ")
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno="&pageno-1&"&id="&Classid&">上一页</a>] ")
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno="&pageno+1&"&id="&Classid&">下一页</a>] ")
Response.Write("[<a class=pagelink href="&PaginationURL&"?pageno="&rs.PageCount&"&id="&Classid&">最后一页</a>] ")
end if
end if
end if

''创建下拉列表框,用于选择浏览页码
Response.Write("第<select size=1 name=pageno onchange=PageCurrent()>")
For i=1 to rs.PageCount
if cstr(request("pageno"))=cstr(i) then
Response.Write("<option value="&i&" selected>"&i&"</option>") ''当前页码
else
Response.Write("<option>"&i&"</option>")
end if
Next
Response.Write("</select value="&i&">页 ")
response.write "</td>"
response.write "</tr>"
Response.Write("</form>")
response.write "</table>"
response.write "</center>"
response.write "</div>"

rs.close
set rs = nothing
else
response.write "<tr>"
response.write "<td width='100%' colspan=3 height=26 align=center>此分类没有商品登记!</td>"
response.write "</tr>"
response.write "</table>"
end if
%>
</body>
</html>
clcy 2005-05-26
  • 打赏
  • 举报
回复
在线等啊
clcy 2005-05-26
  • 打赏
  • 举报
回复

28,406

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧