<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