
ASP如何限制标题字数
这是部分代码,我想限制显示的新闻标题字数为8个,该怎么能设置。谢谢!往上有很多解决办法,可惜我是新手。分数有限,只给了10分,请各位见谅。sql="selecttop"&...
这是部分代码,我想限制显示的新闻标题字数为8个,该怎么能设置。谢谢!往上有很多解决办法,可惜我是新手。分数有限,只给了10分,请各位见谅。
sql="select top "&hotnum&" * from Ft_news order by news_count DESC,news_date desc"
set rs2 = server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
if rs2.bof and rs2.eof then
topnews="<span class=""disable_font"" >内容正在更新之中……</span>"
else
do while not rs2.eof
topnews=topnews+"<img src="""&signimgpath&"/biao.gif"" border=""0""> <a href=shownews.asp?id="&rs2("news_id")&">"&rs2("news_title")&"</a><br>"
rs2.movenext
loop
end if
rs2.close
set rs2=nothing 展开
sql="select top "&hotnum&" * from Ft_news order by news_count DESC,news_date desc"
set rs2 = server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
if rs2.bof and rs2.eof then
topnews="<span class=""disable_font"" >内容正在更新之中……</span>"
else
do while not rs2.eof
topnews=topnews+"<img src="""&signimgpath&"/biao.gif"" border=""0""> <a href=shownews.asp?id="&rs2("news_id")&">"&rs2("news_title")&"</a><br>"
rs2.movenext
loop
end if
rs2.close
set rs2=nothing 展开
2个回答
展开全部
改成:
sql="select top "&hotnum&" * from Ft_news order by news_count DESC,news_date desc"
set rs2 = server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
if rs2.bof and rs2.eof then
topnews="<span class=""disable_font"" >内容正在更新之中……</span>"
else
do while not rs2.eof
topnews=topnews+"<img src="""&signimgpath&"/biao.gif"" border=""0""> <a href=shownews.asp?id="&rs2("news_id")&">"&rs2("left(news_title,8)")&"</a><br>"
rs2.movenext
loop
end if
rs2.close
set rs2=nothing
试试
sql="select top "&hotnum&" * from Ft_news order by news_count DESC,news_date desc"
set rs2 = server.createobject("adodb.recordset")
rs2.open sql,conn,1,1
if rs2.bof and rs2.eof then
topnews="<span class=""disable_font"" >内容正在更新之中……</span>"
else
do while not rs2.eof
topnews=topnews+"<img src="""&signimgpath&"/biao.gif"" border=""0""> <a href=shownews.asp?id="&rs2("news_id")&">"&rs2("left(news_title,8)")&"</a><br>"
rs2.movenext
loop
end if
rs2.close
set rs2=nothing
试试
2008-04-23
展开全部
href=shownews.asp?id="&rs2("news_id")&">"&left(rs2("news_title"),8)&"</a><br>" 'left应放在这个位置
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询