| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 1008 人关注过本帖
标题:产品展示问题
只看楼主 加入收藏
故事人生
Rank: 2
等 级:论坛游民
帖 子:58
专家分:36
注 册:2010-3-30
结帖率:92.31%
收藏
已结贴  问题点数:20 回复次数:5 
产品展示问题
      <TD
                  height=42 colspan="3"><form action="Payment.asp" method="Post" name="Inquire" target="_blank" >
              <table width="100%" border="0" cellspacing="0" cellpadding="0">
                          <tr valign="middle" bgcolor="#F7F7F7" class="stiemap">
                            <td width="52%" height="40" align="left"><% call ShowClassGuide() %></td>
                            <td colspan="2" align="left"><% call ShowProductTotal() %></td>
                          </tr>
                          <tr valign="middle" bgcolor="#F7F7F7" class="stiemap">
                            <td height="40">&nbsp;</td>
                            <td width="23%"><div align="right">
                                <input name="chkAll" type="checkbox" id="chkAll" onClick=CheckAll(this.form) value="checkbox">
                <font color="#ff6600">将所有产品放入询价表</font></div></td>
                            <td width="25%" align="center"><input name="image" type="image" src="Images/inquire_now.gif" style="border: 0px "width="100" height="26" border="0">                            </td>
                          </tr>
                          <tr>
                <tr>
                  <td width="100%" height="15" colspan="3"></td>
                </tr>
                <tr>
                  <td colspan="3" ><% call ShowProduct(32) %>                  </td>
                </tr>
              </table>
          </form></TD>
        </TR>
        <TR>
          <TD
                  height=1 colspan="3"><%
          if totalput>0 then            
              call showpage(strFileName,totalput,MaxPerPage,false,true,"个产品")
          end if
          %>          </TD>
        </TR>
      </table></td>
  </tr>
</table>
<!-- #include file="Inc/Foot.asp" -->
</BODY></HTML>


以上为部分代码

产品展示为每页显示10个产品一行3个,最后一行只有一个产品,不好看.所以想修改一页显示12个产品,如果超出12个,至下页显示!!!
搜索更多相关主题的帖子: 展示 
2010-06-29 11:33
魏兴耀
Rank: 8Rank: 8
来 自:江西
等 级:蝙蝠侠
威 望:3
帖 子:246
专家分:840
注 册:2009-11-9
收藏
得分:20 
你的代码不全,你这个函数:showpage(strFileName,totalput,MaxPerPage,false,true,"个产品")
调用过来,它的源程序呢?

只有大胆尝试,才有机会得到想要的成功
2010-06-29 12:46
故事人生
Rank: 2
等 级:论坛游民
帖 子:58
专家分:36
注 册:2010-3-30
收藏
得分:0 
'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(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
        sqlProduct="select top " & MaxPerPage   
    else
        sqlProduct="select "
    end if

    sqlProduct=sqlProduct & " ID,Product_Id,BigClassName,SmallClassName,IncludePic,Title,Price,Spec,Unit,Memo,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "
   
    if BigClassName<>"" then
        sqlProduct=sqlProduct & " and BigClassName='" & BigClassName & "' "
        if SmallClassName<>"" then
            sqlProduct=sqlProduct & " and SmallClassName='" & SmallClassName & "' "
        end if
    end if
    sqlProduct=sqlProduct & " order by UpdateTime desc"
    Set rsProduct= Server.CreateObject("ADODB.Recordset")
    rsProduct.open sqlProduct,conn,1,1
    if rsProduct.bof and  rsProduct.eof then
        response.Write("<br><li>没有任何产品</li>")
    else
        if currentPage=1 then
            call ProductContent(TitleLen)
        else
            if (currentPage-1)*MaxPerPage<totalPut then
                    rsProduct.move  (currentPage-1)*MaxPerPage
                 dim bookmark
                   bookmark=rsProduct.bookmark
                call ProductContent(TitleLen)
            else
                currentPage=1
                   call ProductContent(TitleLen)
            end if
        end if
    end if
    rsProduct.close
    set rsProduct=nothing
end sub

sub ProductContent(intTitleLen)
          dim i,strTemp,ViewList
         i=1
         ViewList=3
        strTemp=""
        strtemp= strtemp & "<p>"
        strTemp= strTemp & "<TABLE width='98%' align=center  BORDER=0 CELLSPACING=1 CELLPADDING=0>"
        strTemp= strTemp & "<tr>"
    do while not rsProduct.eof
     strTemp= strTemp & "<td width=170>"               
        strTemp= strTemp & "<table align=center width=170 border=0 cellspacing=2 cellpadding=0>"
                strTemp= strTemp & "<tr>"
                strTemp= strTemp & "<td colspan=2>"
              strTemp= strTemp &"<TABLE  border=0 cellPadding=0 cellSpacing=5>"
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD align=middle > <TABLE align=center border=0 cellPadding=0 cellSpacing=0>"      
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD  height=10><IMG height=10 src='Img/bg_0ltop.gif' width=10></TD>"
   strTemp= strTemp &"<TD background='Img/bg_01.gif' height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rtop.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR> "
   strTemp= strTemp &"<TD background='Img/bg_03.gif' width=10>&nbsp;</TD>"
   strTemp= strTemp & "<td width=130 height=100>"&"<div align=center>"
   strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & "<img src=" & rsProduct("DefaultPicUrl") & " width='180' height='130' border='0'>" & "</a><br></div>"  
   strTemp= strTemp & "</td>"
   strTemp= strTemp &"<TD background='Img/bg_04.gif' width=10>&nbsp;</TD>"
   strTemp= strTemp &"</TR>"
   strTemp= strTemp &"<TR>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0lbottom.gif' width=10></TD>"
   strTemp= strTemp &"<TD background=Img/bg_02.gif height=10></TD>"
   strTemp= strTemp &"<TD height=10><IMG height=10 src='Img/bg_0rbottom.gif' width=10></TD>"
   strTemp= strTemp &"</TR>"         
   strTemp= strTemp &"</TABLE></TD>"
   strTemp= strTemp &"</TR>"  
   strTemp= strTemp &"</TABLE>"
                strTemp= strTemp & "</a></div></td>"
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td align=right >"
                strTemp= strTemp & "名称:</td>"
                strTemp= strTemp & "<td width=80% >"
                strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & rsProduct("Title") & ""
                strTemp= strTemp & "</a></td>"
               
                strTemp= strTemp & "</tr><tr>"
                strTemp= strTemp & "<td align=right >"
                strTemp= strTemp & "编号:</td>"
                strTemp= strTemp & "<td>"
                strTemp= strTemp & rsProduct("Product_Id") & ""
                strTemp= strTemp & "</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>"
                strTemp= strTemp & "<div align=center></div></td>"            
               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><input name='Product_Id' type='checkbox'    id='Product_Id' value="&cstr(rsProduct("Product_Id"))&"> 选取"
                strTemp= strTemp & "</div></td>"
               
                strTemp= strTemp & "</tr>"
               
                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>"        
        if i mod ViewList =0 then
           strTemp= strTemp & "</td></tr>"
        end if
           rsProduct.MoveNext      
        i=i+1
        if i>MaxPerPage then exit do            
    loop
        strtemp= strtemp & "</tr></table>"
        response.write strTemp  
end sub
2010-06-29 13:20
故事人生
Rank: 2
等 级:论坛游民
帖 子:58
专家分:36
注 册:2010-3-30
收藏
得分:0 
自己找到了,谢谢!!!!!!!!!!!!
2010-06-29 13:23
hams
Rank: 12Rank: 12Rank: 12
等 级:贵宾
威 望:18
帖 子:912
专家分:3670
注 册:2008-7-30
收藏
得分:0 
这个改动似乎没有必要,除非你永远是11个产品。要不然,你改为12个一面,下次是13个产品呢?又改程序?

俺不高手,俺也是来学习的。
俺的意见不一定就对,当你不认同时请点忽视按钮。
当走到十字路口不知该如何走时,可在论坛问下路,但你若希望别人能一路把你送到目的地,显然是不现实的,因为别人也有自己要走的路。
2010-06-29 15:17
aolangtv
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-6-17
收藏
得分:0 
回复 3 楼 故事人生
我也遇到了你的这个问题,是在哪里修改呢?谢谢说一下!
2014-06-17 10:53
快速回复:产品展示问题
数据加载中...
 
   



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

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