| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 413 人关注过本帖
标题:以下代码如何修改成三行三例啊
只看楼主 加入收藏
蓝浪
Rank: 1
等 级:新手上路
帖 子:1
专家分:0
注 册:2010-5-31
结帖率:0
收藏
已结贴  问题点数:20 回复次数:2 
以下代码如何修改成三行三例啊
以下代码如何修改成三行三例啊。本人是新手。修改好后,请跟贴回复我啊。谢谢
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,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTim
e,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>Not any product</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 & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=25% rowspan=7>"
                strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ArticleID=" & rsArticle
("articleid") & ">"
               
                fileExt=lcase(getFileExtName(rsArticle("DefaultPicUrl")))
                if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
                strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=105 height=80>"
                else
                 if fileext="swf" then
                    strTemp= strTemp & "<object  classid='clsid:D27CDB6E-AE6D-11cf-96B8-
444553540000'  codebase='http://download.,0,0,0'  
width='105' height='84'>"
                    strTemp= strTemp &"<param name=movie value='"&rsArticle
("DefaultPicUrl")&"'>"
                    strTemp= strTemp &"<param name=quality value=high>"
                    strTemp= strTemp &"<param name='Play' value='-1'>"
                    strTemp= strTemp &"<param name='Loop' value='0'>"
                    strTemp= strTemp &"<param name='Menu' value='-1'>"
                    strTemp= strTemp &"<param name='wmode' value='transparent'>"
                    strTemp= strTemp &"<embed src='"&rsArticle("DefaultPicUrl")&"'  
width='105' height='84' pluginspage='http://www.
P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"            
                                    
               end if
              end if            
                 
                strTemp= strTemp & "</a></div></td>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product Name:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">" &  
rsArticle("Title") & ""
                strTemp= strTemp & "</a></td>"
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product selling price:</td>"
                strTemp= strTemp & "<td>" & rsArticle("Price") & "元</td>"               
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product specification:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsArticle("Spec") & ""
                strTemp= strTemp & "</a></td>"
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product note:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsArticle("Memo") & ""
                strTemp= strTemp & "</a></td>"               
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=12>"
                strTemp= strTemp & "Product category:</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><tr>"
               
                strTemp= strTemp & "<td height=12>"
                strTemp= strTemp & "Product serial number :</td>"
                strTemp= strTemp & "<td>" & rsArticle("Product_Id") & "</td>"
                strTemp= strTemp & "</tr><tr>"
               
                strTemp= strTemp & "<td height=12>Product information:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & "><img  
src=Img/arrow_7.gif border=0></a></td>"
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td colspan=2>"
                strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "<div align=center></div></td>"
               
                strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "<div align=center><a href=# onClick=""window.open('add.asp?
Product_Id="&rsArticle("Product_Id")&"','blank_','scrollbars=yes,resizable=no,width=650,height=450')""><img  
border=0 src=img/addtocart.gif width=100 height=26>"
                strTemp= strTemp & "</a></div></td>"
               
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"
                strTemp= strTemp & "</td>"
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"
        response.write strTemp
        rsArticle.movenext
        i=i+1
        if i>=MaxPerPage then exit do   
    loop
end sub

[ 本帖最后由 蓝浪 于 2010-5-31 09:54 编辑 ]
搜索更多相关主题的帖子: 200 如何 
2010-05-31 09:53
gupiao175
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:40
帖 子:1787
专家分:7527
注 册:2007-6-27
收藏
得分:10 
自己改吧,这是个累活,不是技术活:如果你连这个都不乐意去做,那还学什么ASP,把<tr>位置找准了,看其中的<td>有几个,你要怎么布局,几个tr就是几行,几个td就是几列!

 strTemp= strTemp & "<table width=100% border=0 cellspacing=3 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=25% rowspan=7>"
                strTemp= strTemp & "<div align=center><a href=ProductShow.asp?ArticleID=" & rsArticle
("articleid") & ">"
               
                fileExt=lcase(getFileExtName(rsArticle("DefaultPicUrl")))
                if fileext="jpg" or fileext="bmp" or fileext="png" or fileext="gif" then
                strTemp= strTemp & "<img border=0 src=" & rsArticle("DefaultPicUrl") & " width=105 height=80>"
                else
                 if fileext="swf" then
                    strTemp= strTemp & "<object  classid='clsid:D27CDB6E-AE6D-11cf-96B8-
444553540000'  codebase='http://download.,0,0,0'  
width='105' height='84'>"
                    strTemp= strTemp &"<param name=movie value='"&rsArticle
("DefaultPicUrl")&"'>"
                    strTemp= strTemp &"<param name=quality value=high>"
                    strTemp= strTemp &"<param name='Play' value='-1'>"
                    strTemp= strTemp &"<param name='Loop' value='0'>"
                    strTemp= strTemp &"<param name='Menu' value='-1'>"
                    strTemp= strTemp &"<param name='wmode' value='transparent'>"
                    strTemp= strTemp &"<embed src='"&rsArticle("DefaultPicUrl")&"'  
width='105' height='84' pluginspage='http://www.
P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed> </object>"            
                                    
               end if
              end if            
                 
                strTemp= strTemp & "</a></div></td>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product Name:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & ">" &  
rsArticle("Title") & ""
                strTemp= strTemp & "</a></td>"
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product selling price:</td>"
                strTemp= strTemp & "<td>" & rsArticle("Price") & "元</td>"               
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product specification:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsArticle("Spec") & ""
                strTemp= strTemp & "</a></td>"
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td width=12% height=12>"
                strTemp= strTemp & "Product note:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsArticle("Memo") & ""
                strTemp= strTemp & "</a></td>"               
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=12>"
                strTemp= strTemp & "Product category:</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><tr>"
               
                strTemp= strTemp & "<td height=12>"
                strTemp= strTemp & "Product serial number :</td>"
                strTemp= strTemp & "<td>" & rsArticle("Product_Id") & "</td>"
                strTemp= strTemp & "</tr><tr>"
               
                strTemp= strTemp & "<td height=12>Product information:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & "<a href=ProductShow.asp?ArticleID=" & rsArticle("articleid") & "><img  
src=Img/arrow_7.gif border=0></a></td>"
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td colspan=2>"
                strTemp= strTemp & "<table width=100% border=0 cellpadding=0 cellspacing=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "<div align=center></div></td>"
               
                strTemp= strTemp & "<td width=50% height=12>"
                strTemp= strTemp & "<div align=center><a href=# onClick=""window.open('add.asp?
Product_Id="&rsArticle("Product_Id")&"','blank_','scrollbars=yes,resizable=no,width=650,height=450')""><img  
border=0 src=img/addtocart.gif width=100 height=26>"
                strTemp= strTemp & "</a></div></td>"
               
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"
                strTemp= strTemp & "</td>"
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td height=1 colspan=3 bgcolor=#CCCCCC></td>"
                strTemp= strTemp & "</tr>"
                strTemp= strTemp & "</table>"

Q:1428196631,百度:开发地 即可找到我,有事请留言!
2010-05-31 15:37
yms123
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:209
帖 子:12488
专家分:19042
注 册:2004-7-17
收藏
得分:10 
给楼主些提示
行列要用嵌套循环外行内列,比如3行3列
<%
   Dim r,c
   With Response
       .Write "<table>"
       For r=0 To 3'这里循环3行
          .Write "<tr>"
          For c=0 To 3 '这里循环3列
              .Write "<td>第"&r&"行,第"&c&"列</td>"
          Next
          .Write "</tr>"
       Next
      .Write "</table>"
   End With
%>
2010-05-31 15:49
快速回复:以下代码如何修改成三行三例啊
数据加载中...
 
   



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

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