| 编程中国 | 业界新闻 | 技术文章 | 视频教程 | 下载频道 | 程序源码 | 个人空间 | 编程论坛
全能ASP/PHP/ASP.NET主机,支持月付专业 MSSQL 数据库空间,支持月付专业 MySQL 数据库空间,支持月付学习型 ASP/PHP/ASP.NET 主机 30元/年
高端软件开发 = 年薪十万不是梦赛孚耐:软件保护加密专家身份认证令牌USB KEY 
共有 249 人关注过本帖
标题:ASP产品展示问题
收藏  订阅  推荐  打印 
zjwlhxy
Rank: 1
等级:新手上路
帖子:8
积分:180
注册:2007-5-14
ASP产品展示问题

这是一个产品展示界面的代码?展示的产品是3行两列的,我如何改成2行3列的呢?谢谢各位大大解答。把rowcount改成=3变成还是两列,一列4个产品,一列2个产品
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>时尚地带--男人世界</title>
<link href=style.css rel=STYLESHEET type=text/css>
<script language="javascript">
function newswin(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=200,top=200";
oth = oth+",width=500,height=400";
var newswin=window.open(url,"newswin",oth);
newswin.focus();
return false;
}
function newswindow(url) {
var oth="toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,left=0,top=0";
var newswin=window.open(url,"newswin",oth);
newswin.focus();
return false;
}
</script>
</head>
<BODY LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
<table height="250" width="645" border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr><td valign="top">
<%
Dim rs
set rs = server.createobject("adodb.recordset")
sql="select top 30 * from Goods where typeid=2 order by Id desc"
'sql="select * from Goods order by Id desc"
rs.open sql,conn,1,1
if rs.eof then
response.write "<tr><td align=center>目前还没有服装。<br></td></tr>"
else
rs.pagesize=6
ipage=clng(request("page"))
'response.write ipage
if ipage<=0 then
ipage=1
end if

if ipage>=rs.pagecount then
ipage=rs.pagecount
end if

rs.absolutepage=ipage
rowcount=rs.pagesize
do while not rs.eof and rowcount>0
if rowcount=2 then
response.write "</td><td width=1 height=97% bgcolor=#CCCCCC></td><td valign=top>"
end if
%>
<table border="0" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF" valign="top">
<tr>
<%
If isNull(rs("ImageFile")) Then
%>
<td width="73"><img src="images/noImg.jpg" width="100" height="63" hspace="5" vspace="5"></td>
<%else%>
<td width="73"><a href="ViewImage.asp?id=<%=rs("id")%>" onClick="return newswindow(this.href)"><img src="admin/images/<%=rs("imageFile")%>" width="100" height="63" hspace="5" vspace="5" border="0"></td>
<%end if%>
<td width="1" bgcolor="#CCCCCC"></td>
<td>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="20" height="40"><div align="center"><img src="images/rp_bullet.gif" width="7" height="7"></div></td>
<td><span class="style2">服装名称:<%=rs("name")%> </span></td>
</tr>
<tr>
<td height="20"><div align="center"><img src="images/rp_bullet.gif" width="7" height="7"></div></td>
<td><span class="style2">服装编号:<%=rs("Id")%></span></td>
</tr>
<tr>
<td height="20"><div align="center"><img src="images/rp_bullet.gif" width="7" height="7"></div></td>
<td><span class="style2">参考价格:<%=rs("Model")%></span></td>
</tr>
<tr>
<td height="20"> </td>
<td><a href="GoodsView.asp?id=<%=rs("id")%>" onClick="return newswin(this.href)"><span class="111">详细信息</span></a></td>
</tr>
</table></td>
</tr></table>
<table width="100%" height="1" border="0" cellpadding="0" cellspacing="0" bgcolor="#CCCCCC">
<tr>
<td></td>
</tr>
</table>
<%
rs.movenext()
rowcount=rowcount-1
loop
%>
</td></tr>
<tr><td>
<%
if rs.pagecount>1 then
response.write "<table border='0'><tr><td><b>分页:</b></td>"
for i=1 to rs.pagecount
response.write "<td><a href='1.asp?page=" &i& "'>"
response.write "[<b>"&i&"</b>]</a></td>"
next
response.write "</tr></table>"
end if
end if
set rs=nothing
%>
</td></tr>
</table>
</body>

[此贴子已经被作者于2007-8-9 8:56:32编辑过]

搜索更多相关主题的帖子: 时尚  ASP  展示  title  
2007-8-9 08:46
madpbpl
Rank: 6Rank: 6
等级:金牌会员
威望:6
帖子:2513
积分:27238
注册:2007-4-5

if rowcount=2 then
改成
if rowcount mod 2 = 0 then
2007-8-9 12:39
leaftest
Rank: 2
等级:注册会员
帖子:47
积分:570
注册:2007-8-9

恩。。。


help you , help me - -%
2007-8-9 14:41
关于我们 | 广告合作 | 编程中国 | 清除Cookies | Archiver | WAP | TOP

编程中国 版权所有,并保留所有权利。鲁ICP备08000592号
Powered by Discuz, Processed in 0.051589 second(s), 9 queries.
Copyright©2004-2008, BCCN.NET, All Rights Reserved