注册 登录
编程论坛 ASP技术论坛

asp代码中怎样写下拉框?

dhdhzzw 发布于 2010-03-15 17:45, 737 次点击
  Content = Content & "<option value="&Rs("bs1")&"   if """&Rs("bs1")&"""= ""周一""  then response.write(""selected"") >周一</option>"
    Content = Content & "<option value="&Rs("bs2")&"   if """&Rs("bs2")&""" = ""周二""  then response.write(""selected"") >周二</option>"
这样写怎么都不对。取不到值。。。。。。。。。。。到底怎么写啊?
6 回复
#2
yms1232010-03-16 09:04
生成的浏览器HTML代码也没有value值吗?
#3
aspic2010-03-16 09:37
Content = Content & "<option value="&Rs("bs1")&"   if """&Rs("bs1")&"""= ""周一""  then response.write(""selected"") >周一</option>"
不能写在同一行
#4
aspic2010-03-16 09:39
比如
Content = "<option value="&Rs(bs1)&""
if Rs("bs1") = "周一" Then Content = Content & "selected = selected"
Content = Content & "周一</option>"
只是举例 并没有测试 思路肯定是对的
#5
dhdhzzw2010-03-18 11:42
谢谢aspic给的思路

正确代码

Content = "<option value="&Rs(bs1)&""
if Rs("bs1") = "周一" Then Content = Content & "selected = selected"
Content = Content & ">周一</option>"


Content = "<option value="&Rs(bs1)&""
if Rs("bs1") = "周一" Then
Content = Content & "selected = selected"
end if
Content = Content & ">周一</option>"
#6
dhdhzzw2010-03-18 11:44
我突然发现,我的等级怎么变成新手上路了??????试问!!!!!
#7
yms1232010-03-18 11:57
以下是引用dhdhzzw在2010-3-18 11:44:04的发言:

我突然发现,我的等级怎么变成新手上路了??????试问!!!!!
这个你要去问老静,最近论坛等级确实有些错乱。。。
1