日期:2014-05-18  浏览次数:20465 次

怎么找到FromView的ItemTemplate中的RadioButtonList控件?谢谢
呵呵,现在在代码也中找不到ItemTemplate的控件,怎么找啊?
谢谢啦~

------解决方案--------------------
FindControl
------解决方案--------------------
RadioButtonList rbl = FormVeiw1.FindControl( "MyRadioButtonListID ") as RadioButtonList;

// 我想用For Each遍历RadioButtonList中的每个项,确定是否被选中了
// 不需要遍历,因为只有一项能被选中
ListItem item = rbl.SelectedItem;
if(item != null) {
string val = item.Value;
/// ...
}