asp中下拉列表读出数据库里的值并且显示为当前值
假如我在下拉列表定义好的值为c,d,e,我从数据库里读出来d,下拉列表当前值也得是2.见到在asp.net中能实现,可是我这儿必须用asp,请问怎样实现?谢谢!...
假如我在下拉列表定义好的值为c,d,e,我从数据库里读出来d,下拉列表当前值也得是2.见到在asp.net中能实现,可是我这儿必须用asp,请问怎样实现?谢谢!
展开
展开全部
<select>
<option <% if rs("字段名") = "c" then response.write " selected " %> value="c">1</option>
<option <% if rs("字段名") = "d" then response.write " selected " %> value="d">2</option>
<option <% if rs("字段名") = "e" then response.write " selected " %> value="e">3</option>
</select>
<option <% if rs("字段名") = "c" then response.write " selected " %> value="c">1</option>
<option <% if rs("字段名") = "d" then response.write " selected " %> value="d">2</option>
<option <% if rs("字段名") = "e" then response.write " selected " %> value="e">3</option>
</select>
展开全部
没看明白。说明白点才好帮你。。。
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
<select>
<option
<%
if
rs("字段名")
=
"c"
then
response.write
"
selected
"
%>
value="c">1</option>
<option
<%
if
rs("字段名")
=
"d"
then
response.write
"
selected
"
%>
value="d">2</option>
<option
<%
if
rs("字段名")
=
"e"
then
response.write
"
selected
"
%>
value="e">3</option>
</select>
<option
<%
if
rs("字段名")
=
"c"
then
response.write
"
selected
"
%>
value="c">1</option>
<option
<%
if
rs("字段名")
=
"d"
then
response.write
"
selected
"
%>
value="d">2</option>
<option
<%
if
rs("字段名")
=
"e"
then
response.write
"
selected
"
%>
value="e">3</option>
</select>
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询