求助ASP程序修改,asp新闻两列怎么做
求助,asp如何两列展示,一般程序都只有一列,两列要怎么修改呢,麻烦帮我修改下代码,很抱歉没有分了。setrs=server.createobject("adodb.re...
求助,asp 如何两列展示,一般程序都只有一列,两列要怎么修改呢,麻烦帮我修改下代码,很抱歉没有分了。
set rs=server.createobject("adodb.recordset")
sql="select top 100 title,content,file_path,[url],time from [article] where "&ClassSQL&"='"&ItemID&"' and view_yes=1 and ArticleType=1 order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
for i=1 to 100
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=ArticleContent_FolderName&"/"&rs("file_path")
end if
WebNewNewsList=WebNewNewsList&"<tr><td width='75%'>· <a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),19)&"</a></td>"
WebNewNewsList=WebNewNewsList&"<td width='25%'><span>"&year(rs("time"))&"-"&month(rs("time"))&"-"&day(rs("time"))&"</span></td></tr>"
rs_0.close
set rs_0=nothing
rs.movenext
next
else
WebNewNewsList=WebNewNewsList&"暂无信息。"
end if
rs.close
set rs=nothing 展开
set rs=server.createobject("adodb.recordset")
sql="select top 100 title,content,file_path,[url],time from [article] where "&ClassSQL&"='"&ItemID&"' and view_yes=1 and ArticleType=1 order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
for i=1 to 100
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=ArticleContent_FolderName&"/"&rs("file_path")
end if
WebNewNewsList=WebNewNewsList&"<tr><td width='75%'>· <a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),19)&"</a></td>"
WebNewNewsList=WebNewNewsList&"<td width='25%'><span>"&year(rs("time"))&"-"&month(rs("time"))&"-"&day(rs("time"))&"</span></td></tr>"
rs_0.close
set rs_0=nothing
rs.movenext
next
else
WebNewNewsList=WebNewNewsList&"暂无信息。"
end if
rs.close
set rs=nothing 展开
展开全部
dim j
set rs=server.createobject("adodb.recordset")
sql="select top 100 title,content,file_path,[url],time from [article] where "&ClassSQL&"='"&ItemID&"' and view_yes=1 and ArticleType=1 order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
j=1
for i=1 to 100
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=ArticleContent_FolderName&"/"&rs("file_path")
end if
WebNewNewsList=WebNewNewsList&"<td><table width='100%'><tr><td width='75%'>· <a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),19)&"</a></td>"
WebNewNewsList=WebNewNewsList&"<td width='25%'><span>"&year(rs("time"))&"-"&month(rs("time"))&"-"&day(rs("time"))&"</span></td></tr></table></td>"
rs_0.close
set rs_0=nothing
if j mod 2=0 then response.write "</tr><tr>"
rs.movenext
j=j+1
next
else
WebNewNewsList=WebNewNewsList&"暂无信息。"
end if
rs.close
set rs=nothing
set rs=server.createobject("adodb.recordset")
sql="select top 100 title,content,file_path,[url],time from [article] where "&ClassSQL&"='"&ItemID&"' and view_yes=1 and ArticleType=1 order by [time] desc"
rs.open(sql),cn,1,1
if not rs.eof and not rs.bof then
j=1
for i=1 to 100
rs_url=""
if rs("url")<>"" then
rs_url=rs("url")
else
rs_url=ArticleContent_FolderName&"/"&rs("file_path")
end if
WebNewNewsList=WebNewNewsList&"<td><table width='100%'><tr><td width='75%'>· <a href='"&rs_url&"' target='_blank' title='"&rs("title")&"'>"&left(rs("title"),19)&"</a></td>"
WebNewNewsList=WebNewNewsList&"<td width='25%'><span>"&year(rs("time"))&"-"&month(rs("time"))&"-"&day(rs("time"))&"</span></td></tr></table></td>"
rs_0.close
set rs_0=nothing
if j mod 2=0 then response.write "</tr><tr>"
rs.movenext
j=j+1
next
else
WebNewNewsList=WebNewNewsList&"暂无信息。"
end if
rs.close
set rs=nothing
追问
应该是可以的,细节要修改下,显示是变成一列一列了,每个都竖着怎么办,我只要两列,他每个都竖着一列一列
追答
每个都竖着一列一列 = if j mod 2=0 then response.write "" 没起作
把j改成i试下
if i mod 2=0 then WebNewNewsList=WebNewNewsList&""
或
if j mod 2=0 then WebNewNewsList=WebNewNewsList&""
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询