怎样根据从数据库里得到的值改变Dropdownlist的默认值 this.DropDownList1.SelectedValue ="0"; 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 DropDownList1.SelectedItem.Selected = False DropDownList1.SelectedValue = 0 同意楼上的不过用this.DropDownList1.SelectedValue ="0"; 时,这个“0”应该是ValueField,而不是TextField dim x as integer=0for x=0 to DropDownlist1.count-1if DropDownlist.Items(x).Value="0" then DropDownlist.SelectedItem.Index=xend ifnext dropdownlist.Items.FindByValue(a).Selected = Truea为从数据库中读取的值 DropDownList1.SelectIndex = 0; Dim item As ListItem For Each item In lstMainteacher.Items If item.Text = reader.Item("username") Then item.Selected = True End If Next ddl_subclassification_id.Items.FindByValue(a).Selected = Truea为从数据库读取的值!这条语句可以表示,根据数据库中值得不同,选择dropdownlist不同的选项 dropdownlist.Items.FindByValue(a).Selected = True dropdownlist.Items.FindByValue(a).Selected = True解决了 谢谢各位 请教.net程序员发展的问题 .net 跨页面读写cookie 如何实现 怎样在web服务的两个WebMethod之间传递变量? 请各位大侠帮帮忙!!这个问题怎么解决?? 发现了一个可以GPS定位手机位置的网站 我希望在DataGrid里面加一列,是个复选框。每一行都有一个复选框。 Asp.net数据上传问题 请问这两个有什么不同 我怎么在一个页面里做了操作后,同时打开的另一个窗口也同时就这个操作的影响 toolbar控件中的有多个toolbarbutton控件时,如何控制其中某个控钮点击引发某个事件? 请问如何获得一副图片的宽度和高度?高分相送 文件管理系统 这样设计可行吗?
DropDownList1.SelectedValue = 0
不过用this.DropDownList1.SelectedValue ="0"; 时,这个“0”应该是ValueField,而不是TextField
for x=0 to DropDownlist1.count-1
if DropDownlist.Items(x).Value="0" then
DropDownlist.SelectedItem.Index=x
end if
next
dropdownlist.Items.FindByValue(a).Selected = True
a为从数据库中读取的值
For Each item In lstMainteacher.Items
If item.Text = reader.Item("username") Then
item.Selected = True
End If
Next
a为从数据库读取的值!这条语句可以表示,根据数据库中值得不同,选择dropdownlist不同的选项