asp链接问题

来源:百度知道 编辑:UC知道 时间:2024/09/28 15:08:46
<%do while not rs2.eof%>
<tr>
<td bgcolor="#FFFFFF" height="25"><!--公司新闻开始--> <% if rs2("id")=request("id") then %>
<a href="shownews.asp?id=<%=rs2("id")%>&fl=<%=request("fl")%>" title="<%=rs2("title")%>">
<font color="#000000"> <%=left(rs2("title"),40)%> </font> </a>
<%else%>
<a href="shownews.asp?id=<%=rs2("id")%>&fl=<%=request("fl")%>" title="<%=rs2("title")%>"> <font color="#666666"><%=left(rs2("title"),40)%></font> </a>
<% end if%>
</td>
<%
rs2.movenext
loop
rs2.close
%> 意思应该看懂了吧 在循环中如果id=传来的id就显示黑色标题否则为灰色 但是为什么

<%do while not rs2.eof%>
<tr>
<td bgcolor="#FFFFFF" height="25"><!--公司新闻开始--> <% if rs2("id")=clng(request("id")) then %>
<a href="shownews.asp?id=<%=rs2("id")%>&fl=<%=request("fl")%>" title="<%=rs2("title")%>">
<font color="#000000"> <%=left(rs2("title"),40)%> </font> </a>
<%else%>
<a href="shownews.asp?id=<%=rs2("id")%>&fl=<%=request("fl")%>" title="<%=rs2("title")%>"> <font color="#666666"><%=left(rs2("title"),40)%></font> </a>
<% end if%>
</td>
<%
rs2.movenext
loop
rs2.close
%>

我看你的代码基本上是正确的,我稍微调整一下,这样输出,你看是不是可以:

<%
do while not rs2.eof
if rs2("