标题:[求助]一列产品修改成两列显示
只看楼主
ohneliebe
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-1-18
 问题点数:0 回复次数:2 
[求助]一列产品修改成两列显示

<%
sql="select prono,title,picflag,content from product where classcode='" & classcode & "' and state='1' order by sortnum desc"
rs.Open sql,cn,1,1,1
pagesize = 2
rs.PageSize=pagesize

pagecount = rs.PageCount
reccount = rs.RecordCount

pageno = toInt(pageno,1, pagecount)

if pageno > 1 then rs.AbsolutePage = pageno
i=1
do while not rs.EOF and i<=pagesize
%>
这段代码怎么修改才能显示两列产品啊?本人菜菜不会代码,求大家指点啊!

搜索更多相关主题的帖子: pageno pagesize pagecount classcode 
2007-01-18 22:41
四季如春
Rank: 1
等 级:新手上路
帖 子:27
专家分:0
注 册:2006-4-28
得分:0 
toInt 这是自定义函数?怎么只有这么一点代码
2007-01-19 13:54
ohneliebe
Rank: 1
等 级:新手上路
帖 子:2
专家分:0
注 册:2007-1-18
得分:0 
<%@ Language=VBScript%>
<%
Response.Buffer=true
Response.Expires=0
%>
<!-- #include file="dsn_root.asp" -->
<!-- #include file="func.inc.asp" -->

<%
menu = "products"
menu_name = "产品展示"
baseclass = "101"

pageno = toInt(Request.QueryString("pageno"), 1, "")
classcode = toInt(Request.QueryString("classcode"), 0, "")


set cn = Server.CreateObject("adodb.Connection")
set rs = Server.CreateObject("adodb.Recordset")
cn.Open mycnstr


classcode = Request.QueryString("classcode")
pageno = toInt(Request.QueryString("pageno"), 1, "")

if not isnumeric(classcode) then classcode = ""

if classcode="" then
sql="select top 1 classcode,classname from product_class where parentcode='" & baseclass & "' order by sortnum"
else
sql="select classcode,classname from product_class where classcode='" & classcode & "' and parentcode='" & baseclass & "'"
end if

rs.Open sql,cn,0,1,1
if not rs.EOF then
classcode=rs(0)
classname=trim(rs(1))
else
Response.Redirect "default.asp"
end if
rs.Close
%>


<!-- #include file="begin.asp" -->

<table width="798" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td align="center"><img src="images/<%=menu%>/banner_778_<%=classcode%>.jpg" width="798" height="158"></td>
</tr>
</table>
<table width="798" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td rowspan="2" width="10" background="images/show_1.jpg">&nbsp;</td>
<td width="188" height="100%" align="center" valign="top" background="images/bg_title_4.gif">

<!-- #include file="left_product.asp" -->

</td>
<td rowspan="2" width="14" align="center" valign="top" bgcolor="#FFFFFF">&nbsp;</td>
<td rowspan="2" align="left" valign="top" bgcolor="#FFFFFF">
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td align="right"><img src="images/icon_2.gif" width="9" height="9">&nbsp;<span class="font4">位置:</span><a href="default.asp" class="a02">首页</a>
<span class="font1">&gt;</span> <a href="<%=menu%>.asp" class="a02"><%=menu_name%></a> <span class="font1"><font color="#666666">&gt;</font></span>
<a href="<%=menu%>.asp?classcode=<%=classcode%>" class="a02"><%=classname%></a> </td>
</tr>
</table>
<table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="38"><img src="images/icon_1.gif" width="38" height="26"></td>
<td width="120" align="center" class="font5"><%=classname%></td>
<td background="images/bg_title_2.gif">&nbsp;</td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="25">&nbsp;</td>
</tr>
</table>

<%
sql="select prono,title,picflag,content from product where classcode='" & classcode & "' and state='1' order by sortnum desc"
rs.Open sql,cn,1,1,1
pagesize = 2
rs.PageSize=pagesize

pagecount = rs.PageCount
reccount = rs.RecordCount

pageno = toInt(pageno,1, pagecount)

if pageno > 1 then rs.AbsolutePage = pageno
i=1
do while not rs.EOF and i<=pagesize
%>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>

<%
if rs("picflag") = "1" then
%>
<td width="25%"><a href="products_display.asp?prono=<%=rs("prono")%>" target="_blank"><img src="admin/pic_display.asp?code=product&keyno=<%=rs("prono")%>" width="103" height="93" border="0" style="border:1px solid #000000;"></a></td>
<%
else
%>
<td width="25%" style="padding-left:30px;">暂无图片</td>
<%
Response.Write ""
end if
%>
<td valign="top">
<table width="165" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="14" height="14" align="center" bgcolor="#cc0000"><img src="images/products/arrow_1.gif" width="4" height="6"></td>
<td bgcolor="#cc0000"><font color="#FFFFFF"><%=rs("title")%></font></td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td class="font2"><%=left(rs("content"), 50)%>...</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td><a href="products_display.asp?prono=<%=rs("prono")%>" class="a11" target="_blank"><font color="#666666">详细信息 &gt;&gt;</font></a></td>
</tr>
</table>
</td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="30">&nbsp;</td>
</tr>
</table>

<%
i = i + 1
rs.MoveNext
loop
rs.Close
%>


<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="22" align="right">
<%=getPageStr(menu & ".asp?classcode=" & classcode, pageno, pagecount)%>
</td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="5" background="images/line_point3.gif"></td>
</tr>
</table>
<table width="95%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>&nbsp;</td>
</tr>
</table>
</td>
<td rowspan="2" width="10" background="images/show_2.jpg">&nbsp;</td>
</tr>

<tr>
<td align="center" valign="bottom" background="images/bg_title_4.gif">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr height="20">
<td></td>
</tr>
<tr>
<td><img src="images/picture_bottom.gif" width="188" height="168"></td>
</tr>
</table>
</td>
</tr>
</table>
</table>

<!-- #include file="end.asp" -->
这是products.asp的所有代码,求大家指点
2007-01-19 19:06



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-116833-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.881147 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved