刀剑神域莉法结衣本子:写个ASP程序

来源:百度文库 编辑:杭州交通信息网 时间:2024/04/30 11:28:50
我有个页面
地址是:
http://www.so360.cn/productshow/smalllist0.asp?sortid=2

有个ASP代码是下面这样的

<br>
<%
sortsql="select * from class_2 where sortid="&rssort("sortid")&""
set rssort=conn.execute(sortsql)
if rssort.eof then
response.write"暂无行业分类"
else
do while not rssort.eof
%>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<TBODY>
<TR>
<TD width="52%" class=padd><img border="0" src="../images/icon_4x7_arrow.gif" width="8" height="7"> <A href="list.asp?typeid=<%=rssort("typeid")%>" class=M><%=rssort("typename")%></A>
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<%
typesql="select * from class_3 where typeid="&rssort("typeid")&""
set rstype=conn.execute(typesql)
for i=0 to 3
for i1=0 to 3
i=i+1
response.write"<a href='third.asp?third="&rstype("third")&"&typeid="&rstype("typeid")&"&sortid="&rstype("sortid")&"'>"&rstype("thirdname")&"</a> "
rstype.movenext
next
i=i-1
next
%></td>
</tr>
</table></TD>
</TR>
</TBODY>
</TABLE>
<%
rssort.movenext
loop
end if
rssort.close
set rssort=nothing
%>

我要实现的是:通讯社、记者站 报社、杂志社 其他出版机构 书店、图书贸易

这个小类中
记者站 报社 和 杂志社 之间换一行,也就是说在ASP程序中加个“<br>”
请问怎么写
页面上
通讯社、记者站 报社、杂志社 其他出版机构 书店、图书贸易

没有显示

这些小类是应该在 新闻出版业下面显示的

楼主请参考以下代码,至于每于输出多少个,请改动变量B的值即可。
<%
set rs=server.createobject("adodb.recordset")
rs.open "select * from class_3 where typeid="&rssrot("typeid"),conn,1,1
if rs.eof and rs.bof then
response.write "没有分类"
else
dim a,b,c
a=rs.recordcount
b=2 'b代表每行输出多少个
if (a mod b)=0 then
c=a/b
else
c=int(a/b)+1
end if
'通过以上判断得出共多少行,即c
for i=1 to c
if rs.eof then
exit for
end if
for ii=1 to b
if rs.eof then
exit for
end if
response.write "<a href='xxx.asp'>"&rs("thirdname")&"</a>"
rs.movenext
next
response.write "<br>"
next
end if
rs.close
set rs=nothing
%>

response.write("<br");