ddlTypeName.SelectedValue=rooType.TypeName.ToString();
用DropDownList的SelectedValue属性运行程序时显示不出rooType.TypeName有值,但是DropDownList下拉列表中却显不出来,该怎么办?
还有RadioButtonList:rdoList.SelectedValue=rooType.IsAdd
运行时显示不出来值
用RadioButtonList的哪个属性接受该值?
SelectedValue属性是获取, 不是设置.
可以用以下两种方法:
1. DropDownList1.SelectedIndex = 2;
2. DropDownList1.Items.FindByValue(rooType.TypeName.ToString()).Selected = true;
可以用以下两种方法:
1. DropDownList1.SelectedIndex = 2;
2. DropDownList1.Items.FindByValue(rooType.TypeName.ToString()).Selected = true;
本文探讨了在ASP.NET Web应用程序中如何正确地使用DropDownList与RadioButtonList控件。针对DropDownList的SelectedValue属性无法正常显示的问题,提出了两种解决方法,并解释了RadioButtonList的相关属性设置。
2067

被折叠的 条评论
为什么被折叠?



