问题描述
<%outnum=0Response.write"<tablewidth="600"align="center"style="Line-height:12pt">"Response.write"<tr><tdheight="1"colspan="2"></td></tr>"Response.write"<tr><tdwidth="50"height="30"align="center"><imgsrc="images/008.jpg"></td>"iflen(rs("title"))>20thenResponse.write"<tdwidth=550height=30>"Response.write"<aclass='news'href='show.asp?newsid="&rs("newsid")&"'target='_blank'title='发布时间:"&rs("senddate")&chr(13)&chr(10)&"阅读次数:"&rs("visitednum")&"'>elseResponse.write"<tdwidth="550"height="30">"Response.write"<aclass='news'href='show.asp?newsid="&rs("newsid")&"'target='_blank'title='发布时间:"&rs("senddate")&chr(13)&chr(10)&"阅读次数:"&rs("visitednum")&"'>Response.write"rs("title")&"<fontcolor=#cccccc>["&left(rs("posttime"),10&"]</font>)"rs.movenextoutnum=outnum+1LoopDowhileoutnum<5Response.write"<tr><tdheight="1"colspan="2"></td></tr>"Response.write"<tr><tdwidth="50"height="30"> </tdwidth="550"height="60"> </td></tr>"outnum=outnum+1LoopResponse.write"</table>"rs.closesetrs=nothing%>
解决方案
解决方案二:
Dowhileoutnum<5这个地方要是超过呢?
解决方案三:
<%outnum=0dowhilenotrs.eof%>Response.write"<tablewidth="600"align="center"style="Line-height:12pt">"Response.write"rs("title")&"<fontcolor=#cccccc>["&left(rs("posttime"),10&"]</font>)"Response.write"<tr><tdheight="1"colspan="2"></td></tr>"Response.write"<tr><tdwidth="50"height="30"> </tdwidth="550"height="60"> </td></tr>"Response.write"</table>"<%outnum=outnum+1ifoutnum<5thenexitdors.movenextloop%>这样试试。
解决方案四:
这是asp代码。好象少了代码,第一个loop找不到while.if..else也找不到endif