看看两句ASP代码
<select name="typeid"><option value="selected">--所有行业--</option>
<%
set rs=server.createobject("adodb.recordset")
sql="select * from newstype"
rs.open sql,conn,1,1
do while not rs.eof
if typeid=cstr(rs("typeid")) then
sel="selected"
else
sel=""
end if
response.write "<option " & sel & " value='"+CStr(rs("typeID"))+"' name=typeid>"+rs("type")+"新闻</option>"+chr(13)+chr(10)
rs.movenext
loop
rs.close
%>
我想问一下,其中两句什么意思:
if typeid=cstr(rs("typeid")) then
sel="selected"
else
sel=""
还有:response.write "<option " & sel & " value='"+CStr(rs("typeID"))+"' name=typeid>"+rs("type")+"新闻</option>"+chr(13)+chr(10)
这两句话是什么意思呢