| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 675 人关注过本帖
标题:遇到了一个 ASP 的产品显示的问题,有知道的师兄们能说一下吗?万分感谢!
只看楼主 加入收藏
aolangtv
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-6-17
结帖率:0
收藏
已结贴  问题点数:20 回复次数:4 
遇到了一个 ASP 的产品显示的问题,有知道的师兄们能说一下吗?万分感谢!
form action="Payment.asp" method="post" name="Inquire" target="_blank" id="Inquire" >
                                  <table width="100%" border="0" cellspacing="0" cellpadding="0">
 
                                    <tr>
                                      <td width="100%" height="5" colspan="3"></td>
                                    </tr>
                                    <tr>
                                      <td colspan="3" ><% call ShowProduct(32) %>

</td>
                                    </tr>
                                  </table>
</form>

以上为部分代码
产品展示为每页显示10个产品一行3个,最后一行只有一个产品,不好看.所以想修改一页显示12个产品,如果超出12个,至下页显示!!!


'=================================================
'过程名:ShowProduct
'=================================================
sub ShowProduct(TitleLen)
if TitleLen200 then
TitleLen=50
end if
    if currentpagetotalput 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("
产品正在更新中...")
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 & "
"
strTemp= strTemp & ""
strTemp= strTemp & ""
do while not rsProduct.eof
 strTemp= strTemp & ""
   
   strTemp= strTemp &""      
strTemp= strTemp &" "
   strTemp= strTemp & ""
   strTemp= strTemp & "" & "" & "
"  
      strTemp= strTemp & ""
   strTemp= strTemp &""   
strTemp= strTemp &" "
   strTemp= strTemp & ""
      strTemp= strTemp & "" & rsProduct("Title") & ""
      strTemp= strTemp & ""
   strTemp= strTemp &""
   strTemp= strTemp &""
      
        if i mod ViewList =0 then
   strTemp= strTemp & "MaxPerPage then exit do
loop
strtemp= strtemp & ""
response.write strTemp  
end sub


谢谢哪位朋友帮忙说一下,在第二段代码过程名的修改,说一下,谢谢,我想产品显示为四行三列,也就是显示12个产品,超过12个跳转下一页,谢谢了
搜索更多相关主题的帖子: blank action border method target 
2014-06-17 10:55
ysf0181
Rank: 16Rank: 16Rank: 16Rank: 16
等 级:版主
威 望:55
帖 子:914
专家分:2385
注 册:2006-10-4
收藏
得分:10 
dim MaxPerPage
MaxPerPage = 12

写在文件的头部

ASP讨论QQ群:251346273
2014-06-17 14:33
aolangtv
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2014-6-17
收藏
得分:0 
回复 2 楼 ysf0181
你好,是写在哪个文件的头部呢?谢谢帮忙说一下,谢谢你!
2014-06-19 00:15
hu9jj
Rank: 20Rank: 20Rank: 20Rank: 20Rank: 20
来 自:红土地
等 级:贵宾
威 望:400
帖 子:11771
专家分:43421
注 册:2006-5-13
收藏
得分:10 
这个变量肯定是已经定义了的,不需要重复定义。只要找到MaxPerPage=10的位置,将10改为12就行。

活到老,学到老!http://www.(该域名已经被ISP盗卖了)E-mail:hu-jj@
2014-06-20 07:01
ginhua
Rank: 1
等 级:新手上路
帖 子:5
专家分:0
注 册:2014-7-15
收藏
得分:0 
好像没有看到有MaxPerPage=10 呀
2014-08-04 13:56
快速回复:遇到了一个 ASP 的产品显示的问题,有知道的师兄们能说一下吗?万分感 ...
数据加载中...
 
   



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

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