主题:  关于产品展示的排列问题~请哥哥教教~

calecai

职务:普通成员
等级:1
金币:0.0
发贴:12
#12006/7/5 13:46:48

这个代码是一直竖排下去的`如果改成一列排三样产品就换行的模排展示模式~~要怎么修改
我尝试加入 <%if i mod 3= 0 then%>
<%end if
rs.movenext
i=i+1
loop
rs.close
end if
end if
%>
都不成功~
请大大们帮个忙~


现在代码如下~

''=================================================
''过程名:ShowArticle
''=================================================
sub ShowArticle(TitleLen)
if TitleLen<0 or TitleLen>200 then
TitleLen=50
end if
if currentpage<1 then
currentpage=1
end if
if (currentpage-1)*MaxPerPage>totalput then
if (totalPut mod MaxPerPage)=0 then
currentpage= totalPut \ MaxPerPage
else
currentpage= totalPut \ MaxPerPage + 1
end if
end if
if currentPage=1 then
sqlArticle="select top " & MaxPerPage
else
sqlArticle="select "
end if

sqlArticle=sqlArticle & " ArticleID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Spec,Size,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "

if BigClassName<>"" then
sqlArticle=sqlArticle & " and BigClassName=''" & BigClassName & "'' "
if SmallClassName<>"" then
sqlArticle=sqlArticle & " and SmallClassName=''" & SmallClassName & "'' "
end if
else
if SpecialName<>"" then
sqlArticle=sqlArticle & " and SpecialName=''" & SpecialName & "'' "
end if
end if
sqlArticle=sqlArticle & " order by articleid desc"
Set rsArticle= Server.CreateObject("ADODB.Recordset"
rsArticle.open sqlArticle,conn,1,1
if rsArticle.bof and rsArticle.eof then
response.Write("<br><li>没有任何产品</li>"
else
if currentPage=1 then
call ArticleContent(TitleLen)
else
if (currentPage-1)*MaxPerPage<totalPut then
rsArticle.move (currentPage-1)*MaxPerPage
dim bookmark
bookmark=rsArticle.bookmark
call ArticleContent(TitleLen)
else
currentPage=1
call ArticleContent(TitleLen)
end if
end if
end if
rsArticle.close
set rsArticle=nothing
end sub

sub ArticleContent(intTitleLen)
dim i,strTemp
i=0
do while not rsArticle.eof
strTemp=""
''strTemp = strTemp & ""
strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=30% rowspan=6>"
strTemp= strTemp & "<div align=center><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid" & ">"
strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl" & " width=120 height=120 >"
strTemp= strTemp & "</a></div></td>"
strTemp= strTemp & "<td width=13% height=12>产品名称:</td>"
strTemp= strTemp & "<td><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid" & ">" & rsArticle("Title" & "</a></td>"
strTemp= strTemp & "</tr>"

strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td width=13% height=12>产品规格:</td>"
strTemp= strTemp & "<td>" & rsArticle("Spec" & "</td>"
strTemp= strTemp & "</tr>"

strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td height=12>产品类别:</td>"
strTemp= strTemp & "<td><a href=''Product.asp?BigClassName=" & rsArticle("BigClassName" & "''>" & rsArticle("BigClassName" & "</a> "
strTemp= strTemp & "<a href=''Product.asp?BigClassName=" & rsArticle("BigClassName" & "&SmallClassName=" & rsArticle("SmallClassName" & "''>" & rsArticle("SmallClassName" & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr>"

strTemp= strTemp & "<tr>"
strTemp= strTemp & "<td height=12>产品信息:</td>"
strTemp= strTemp & "<td><a href=ArticleShow.asp?ArticleID=" & rsArticle("articleid" & "><img src=Img/arrow_7.gif border=0></a></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i>=MaxPerPage then exit do
loop
end sub



蓝鲸

职务:版主
等级:5
金币:42.1
发贴:2614
#22006/7/6 7:33:57
colNum = 3

for i = 1 to rs.PageSize/colNum
    if rs.Eof then exit for
    for j = 1 to colNum
        if rs.Eof then
            ' 显示空格代码
        else
            ' 显示图片代码
            rs.MoveNext()
        end if        
    next
next


非常大鱼