急。急。asp实现两列多行输出代码
'================================================='过程名:ShowArticle'==================...
'=================================================
'过程名:ShowArticle
'=================================================
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,mobel,price,DefaultPicUrl,UpdateTime,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>没有任何车辆</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
strTemp= "<tr>"
do while not rsArticle.eof
strTemp= strTemp & "<td>"
strTemp= strTemp & "<table width=50% border=0 cellspacing=3
cellpadding=0>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle
("articleid") & ">"
strTemp= strTemp & "<img border=0 src='../"& rsArticle
("DefaultPicUrl") & "' width=180 height=140>"
strTemp= strTemp & "</a></td></tr>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td width=240 height=12>"
strTemp= strTemp & "名 称:<a href=ArticleShow.asp?ArticleID=" &
rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i mod 2=0 then
strtemp= strtemp & "</tr>"
strtemp= strtemp & "<tr>"
end if
if i>=MaxPerPage then exit do
loop
end sub
有一大堆产品重复,只有最下面那组才是不重复的。。。
如:我每页输出10个产品:第一个产品就会重复出现10个,第二个出现9个...i=i-1;
如:
1
12
123
1234
12345
123456
1234567
12345678
我要的是:
12
34
56
78
可以的话加我QQ70101486我把文件传给你。。
急....急....急....急....急....急....急.... 展开
'过程名:ShowArticle
'=================================================
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,mobel,price,DefaultPicUrl,UpdateTime,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>没有任何车辆</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
strTemp= "<tr>"
do while not rsArticle.eof
strTemp= strTemp & "<td>"
strTemp= strTemp & "<table width=50% border=0 cellspacing=3
cellpadding=0>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle
("articleid") & ">"
strTemp= strTemp & "<img border=0 src='../"& rsArticle
("DefaultPicUrl") & "' width=180 height=140>"
strTemp= strTemp & "</a></td></tr>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td width=240 height=12>"
strTemp= strTemp & "名 称:<a href=ArticleShow.asp?ArticleID=" &
rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i mod 2=0 then
strtemp= strtemp & "</tr>"
strtemp= strtemp & "<tr>"
end if
if i>=MaxPerPage then exit do
loop
end sub
有一大堆产品重复,只有最下面那组才是不重复的。。。
如:我每页输出10个产品:第一个产品就会重复出现10个,第二个出现9个...i=i-1;
如:
1
12
123
1234
12345
123456
1234567
12345678
我要的是:
12
34
56
78
可以的话加我QQ70101486我把文件传给你。。
急....急....急....急....急....急....急.... 展开
1个回答
展开全部
你换一下这个过程看看!~
sub ArticleContent(intTitleLen)
dim i,strTemp
i=0
strTemp=""
strTemp = strTemp & "<table width=95% border=0 cellspacing=1 cellpadding=0 align=center>"
strTemp= "<tr>"
do while not rsArticle.eof
strTemp= strTemp & "<td>"
strTemp= strTemp & "<table width=50% border=0 cellspacing=3
cellpadding=0>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle
("articleid") & ">"
strTemp= strTemp & "<img border=0 src='../"& rsArticle
("DefaultPicUrl") & "' width=180 height=140>"
strTemp= strTemp & "</a></td></tr>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td width=240 height=12>"
strTemp= strTemp & "名 称:<a href=ArticleShow.asp?ArticleID=" &
rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i mod 2=0 then
strtemp= strtemp & "</tr>"
end if
if i>=MaxPerPage then exit do
loop
strTemp= strTemp & "</table>"
response.write strTemp
end sub
sub ArticleContent(intTitleLen)
dim i,strTemp
i=0
strTemp=""
strTemp = strTemp & "<table width=95% border=0 cellspacing=1 cellpadding=0 align=center>"
strTemp= "<tr>"
do while not rsArticle.eof
strTemp= strTemp & "<td>"
strTemp= strTemp & "<table width=50% border=0 cellspacing=3
cellpadding=0>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td>"
strTemp= strTemp & "<a href=ArticleShow.asp?ArticleID=" & rsArticle
("articleid") & ">"
strTemp= strTemp & "<img border=0 src='../"& rsArticle
("DefaultPicUrl") & "' width=180 height=140>"
strTemp= strTemp & "</a></td></tr>"
strTemp= strTemp & "<tr align=center>"
strTemp= strTemp & "<td width=240 height=12>"
strTemp= strTemp & "名 称:<a href=ArticleShow.asp?ArticleID=" &
rsArticle("articleid") & ">" & rsArticle("Title") & ""
strTemp= strTemp & "</a></td>"
strTemp= strTemp & "</tr>"
strTemp= strTemp & "</table>"
response.write strTemp
rsArticle.movenext
i=i+1
if i mod 2=0 then
strtemp= strtemp & "</tr>"
end if
if i>=MaxPerPage then exit do
loop
strTemp= strTemp & "</table>"
response.write strTemp
end sub
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询