ASP控制标题字数

来源:百度知道 编辑:UC知道 时间:2024/05/03 03:31:40
<% Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc") %>
<% IF Not (Rs.EOF AND Rs.BOF) Then %>
<% While not rs.eof %>
<% Response.Write "<img src=images/jt.gif> <a href=News.asp?ID="& Rs("ID") &"><font color=#FFCC00>"&rs("Title")&"</font></a><br>"%>
<% Rs.MoveNext %>
<% Wend %>
<% End IF %>
<% Rs.Close %>
<% Set Rs = Nothing %>

哪位教师帮忙整一下!

<%
Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc")
IF Not (Rs.EOF AND Rs.BOF) Then
Do While not rs.eof
Response.Write "<img src=images/jt.gif> <a href=News.asp?ID="& Rs("ID") &"><font color=#FFCC00>"&Left(rs("Title"),6)&"</font></a><br>"
Rs.MoveNext
loop
End IF
Rs.Close
Set Rs = Nothing
%>

<%
Set Rs = Conn.Execute("Select top 5 * From News Where Class = '001' Order By DateTime Desc")
IF Not (Rs.EOF AND Rs.BOF) Then
While not rs.eof
%>
<img src=images/jt.gif> <a href="News.asp?ID=<%=Rs("ID")%>"><font color=#FFCC00><%=rs("Title")%></font></a><br>
<%
Rs.MoveNext
Wend
End IF
Rs.Close
Set Rs = Nothing
%