求助:ASP显示商品的时候 没有没有排满12个就换下一页了

qq87625014 2011-07-18 09:18:55
http://www.whwxtx.cn/Product.asp

源码是
<table width="980" height="38" border="0" cellpadding="0" cellspacing="0" background="imgbeb/product1.gif">
<tbody>
<tr>
<td align="center" width="250"> </td>
<td
style=" padding-left:20px;VERTICAL-ALIGN: middle; PADDING-TOP: 2px"><span><img height="9" src="imgbeb/arrow3.jpg" width="9" /> 当前位置 : <a href="Index.asp"> 首页 </a> - 产品展示</span></td>
</tr>
</tbody>
</table>

<table cellspacing="0" cellpadding="0" width="980" border="0">
<tbody>
<tr>
<td class="bg_display_left" valign="top" align="middle" width="247">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="12"></td>
</tr>
</table>




<table cellspacing="0" cellpadding="0" width="100%" border="0" >

<% call ShowSmallClass_Tree() %>




</TABLE>

<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td height="10"></td>
</tr>
</table>


<!--#include file="qq.asp"-->
<td valign="top" align="middle" width="733"><table cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
<tr>
<td class="text_display" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="226" height="30"><% call ShowClassGuide() %></td>
<td width="227"> </td>
<td width="102"><% call ShowProductTotal() %></td>
</tr>
<tr>
<td
height="42" colspan="3"><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(20) %> </td>
</tr>
</table>
</form></td>
</tr>
<tr>
<td height="1" colspan="4">

<%
if totalput>0 then
call showpage(strFileName,totalput,MaxPerPage,false,true,"个产品")
end if
%>
</td>
</tr>
</table></td>
</tr>
</tbody>
</table>
<table cellspacing="0" cellpadding="0" width="707" border="0">
<tbody>
<tr>
<td><img height="1" src="imgbeb/line_display.jpg" width="707" /></td>
</tr>
<tr>
<td align="right" height="32"><a href="#"><img height="12" src="imgbeb/button_up.jpg" width="37" border="0" /></a></td>
</tr>
</tbody>
</table></td>
</tr>
</tbody>
</table>
...全文
148 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
lindy7758 2011-07-19
  • 打赏
  • 举报
回复
是计数问题,比如i=0 和i=1 i=i+1 出现的情况是不同的
dgdyq 2011-07-19
  • 打赏
  • 举报
回复
MaxPerPage, 请搜索该变量,改为12。
qq87625014 2011-07-19
  • 打赏
  • 举报
回复
问题已经解决 是在CONFIG 文件中修改 谢谢了
dgdyq 2011-07-19
  • 打赏
  • 举报
回复
去global.asa中找MaxPerPage,估计在那里设置 了Application("MaxPerPage")。。。。。
qq87625014 2011-07-19
  • 打赏
  • 举报
回复
以上是我的变量信息 麻烦高手帮我看看
qq87625014 2011-07-19
  • 打赏
  • 举报
回复
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> </TD>"
strTemp= strTemp & "<td width=170 height=130>"&"<div align=center>"
strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & "<img src=" & rsProduct("DefaultPicUrl") & " width='170' height='130' border='0' >" & "</a><br></div>"
strTemp= strTemp & "</td>"
strTemp= strTemp &"<TD background='Img/bg_04.gif' width=10> </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=center>"
strTemp= strTemp & "<td >"
strTemp= strTemp & "<a href=ProductShow.asp?ID=" & rsProduct("id") & ">" & rsProduct("Title") & ""
strTemp= strTemp & "</a></td>"

strTemp= strTemp & "</tr><tr>"
strTemp= strTemp & "<td align=center>"

strTemp= strTemp & "<td>"

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 & "</td>"

strTemp= strTemp & "</tr>"

strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
strTemp= strTemp & "</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
qq87625014 2011-07-18
  • 打赏
  • 举报
回复
麻烦仔细帮我看下 我没有发现有PageSize 等字眼
itakeblue 2011-07-18
  • 打赏
  • 举报
回复
因为现在是10个产品/页,找到显示商品列表的代码,把PageSize改为12即可

28,391

社区成员

发帖
与我相关
我的任务
社区描述
ASP即Active Server Pages,是Microsoft公司开发的服务器端脚本环境。
社区管理员
  • ASP
  • 无·法
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧