变量text记录了健康状况,下拉列表框索引为0的项是“良好”,以此类推。你要的功能可以用下面的代码实现:string text = "一般";if (text=="良好") DropDownList_health.SelectedIndex = 0;
else if(text=="一般") DropDownList_health.SelectedIndex = 1;
else if(text=="生活不能自理") DropDownList_health.SelectedIndex = 2;
else if(text=="一般") DropDownList_health.SelectedIndex = 1;
else if(text=="生活不能自理") DropDownList_health.SelectedIndex = 2;
解决方案 »
- asp.net怎么做类似于Google,百度那样的搜索提示?
- AutoCompleteExtender 能否针对对个控件模糊匹配
- 关于ActiveX和windows form control
- 在一个页面中如何动态给页面中的SqlDataSource控件中的参数赋值
- 关于水晶报表打包的问题
- 当单击treeview中一个节点在客户端JS脚本里取得对应的text?
- 服务器端水晶报表登陆失败????
- 大家帮我看看:这样用SQLCommand更新数据库为什么更新不成功???
- 关于devexpress报表控件怎么格式化时间货字符串,如图:
- 如果获得的Json字符串中的Key名称与自定义的属性名字不同,怎样反序列化这个json串
- 请问这是什么错误
- 页面刷新的时候出现对话框
{
if(DropDownList4.Items[i].Text.Trim()==strp)
{
DropDownList4.Items[i].Selected=true;
}
}
Dim ddlItemIndex As Integer = ddlKindM.Items.IndexOf(myListItem)
ddlKindM.SelectedIndex = ddlItemIndex