asp 菜鸟问:怎样让标题只显示前十个?请帮忙改一下,谢谢!
<!--#includefile="Comm/conn.asp"--><!DOCTYPEHTMLPUBLIC"-//W3C//DTDHTML4.0Transitional...
<!--#include file="Comm/conn.asp" -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<body text="#000000" background="images/fig_background.gif">
<CENTER>
<table width="780" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF" >
<tr>
<td width="758">
<table width="780" border="0" cellpadding=0 cellspacing=0 align="center" bgcolor="#FFFFFF">
<tr>
<td height="100" valign="top" align="left">
<table cellspacing=0 cellpadding=0 width=200 bgcolor=#FFFFFF border=0 class="new" align="left">
<%
sqlnews = "select * from News where online=true and now()<OffDate and now()>=PubDate and NewsClass='网站动态' order by uup desc,Pubdate desc"
set rsnews=Server.CreateObject("ADODB.RecordSet")
rsnews.open sqlnews,conn,1,1
%>
<tbody>
<tr>
<td width=98% valign=top>
<table bordercolorlight="#C0C0C0" cellpadding="2" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" cellspacing="0" border=0 width=95% align=left bgcolor=#FFFFFF>
<%
if rsnews.eof and rsnews.bof then
response.write "<tr><td height=50 align=center>最近没有新闻公告</td></tr>"
else
Do while Not rsnews.eof
%>
<tr>
<td width=39% valign="top"> <a href="news_detail.asp?NewsId=<%=Cstr(rsnews("NewsId"))%>" target="_blank"><%=rsnews("NewsTitle")%></a></td>
</tr>
<%
rsnews.movenext
loop
end if
set rsnews=nothing
'******************************
%>
</table>
</td>
</tr>
</tbody>
</table>
</BODY>
</HTML> 展开
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<body text="#000000" background="images/fig_background.gif">
<CENTER>
<table width="780" border="0" cellspacing="0" cellpadding="0" align="center" bgcolor="#FFFFFF" >
<tr>
<td width="758">
<table width="780" border="0" cellpadding=0 cellspacing=0 align="center" bgcolor="#FFFFFF">
<tr>
<td height="100" valign="top" align="left">
<table cellspacing=0 cellpadding=0 width=200 bgcolor=#FFFFFF border=0 class="new" align="left">
<%
sqlnews = "select * from News where online=true and now()<OffDate and now()>=PubDate and NewsClass='网站动态' order by uup desc,Pubdate desc"
set rsnews=Server.CreateObject("ADODB.RecordSet")
rsnews.open sqlnews,conn,1,1
%>
<tbody>
<tr>
<td width=98% valign=top>
<table bordercolorlight="#C0C0C0" cellpadding="2" bordercolor="#FFFFFF" bordercolordark="#FFFFFF" cellspacing="0" border=0 width=95% align=left bgcolor=#FFFFFF>
<%
if rsnews.eof and rsnews.bof then
response.write "<tr><td height=50 align=center>最近没有新闻公告</td></tr>"
else
Do while Not rsnews.eof
%>
<tr>
<td width=39% valign="top"> <a href="news_detail.asp?NewsId=<%=Cstr(rsnews("NewsId"))%>" target="_blank"><%=rsnews("NewsTitle")%></a></td>
</tr>
<%
rsnews.movenext
loop
end if
set rsnews=nothing
'******************************
%>
</table>
</td>
</tr>
</tbody>
</table>
</BODY>
</HTML> 展开
展开全部
<%
if rsnews.eof and rsnews.bof then
response.write "<tr><td height=50 align=center>最近没有新闻公告</td></tr>"
else
Dim i
i=1 '这里定义一个变量i控制显示数
Do while Not (rsnews.eof or i>10)
%>
……
<%
rsnews.movenext
i=i+1
loop
end if
set rsnews=nothing
'******************************
%>
if rsnews.eof and rsnews.bof then
response.write "<tr><td height=50 align=center>最近没有新闻公告</td></tr>"
else
Dim i
i=1 '这里定义一个变量i控制显示数
Do while Not (rsnews.eof or i>10)
%>
……
<%
rsnews.movenext
i=i+1
loop
end if
set rsnews=nothing
'******************************
%>
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询