<select name="anclassid" size="1" id="anclassid" >
<%
do while not rs.eof
%>
<option value="<%=rs("anclassid")%>" <% if(rs("anclassid")=rs1("anclassid")) then %> selected <%end if%>><%=trim(rs("anclass"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
<%
do while not rs.eof
%>
<option value="<%=rs("anclassid")%>" <% if(rs("anclassid")=rs1("anclassid")) then %> selected <%end if%>><%=trim(rs("anclass"))%></option>
<%
rs.movenext
loop
end if
rs.close
%>
</select>
博客展示了一段ASP代码,用于创建一个下拉框并填充数据。通过循环遍历记录集,将每条记录的相关信息添加到下拉框选项中,还设置了选中状态,最后关闭记录集。
1385

被折叠的 条评论
为什么被折叠?



