ASP代码控制输出信息条数以及字数

来源:百度知道 编辑:UC知道 时间:2024/06/27 10:06:24
'=================================================
'过程名: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,DefaultPicUrl,UpdateTime,Hits from Product where Passed=True "

if BigClassName<>"" then
sqlArticle=sqlArticle & " and BigClass

dim i,strTemp i=0 do while not rsArticle.eof
用这句控制一下

MaxPerPage应该是你每页显示的最多条数吧,你只用在最开始给他赋值就行了,你的要求是每页显示10条,那么只用这样赋值
const MaxPerPage=10就可以
至于文字控制,TitleLen就是文字的数目,你只用将32改为你想要输出的字数就可以了
<% call ShowArticle(32) %>