我在我的ascx页面上有一个单选按钮列表控件,并且在渲染时有一堆要显示的选项(5)。我从sharepoint列表项中提取这些选项。我想检查一下SelectedIndex是第一个单选按钮,第二个,第三个,第四个或第五个。执行此比较的正确语法是什么?rBtnList.SelectedIndex==?
我需要这样做,因为我想在每个TotalChoice列下面增加一个计数器。谢谢
发布于 2012-03-21 21:48:59
使用switch...case..something,如下所示
switch (rBtnList.SelectedIndex)
{
case 0:
//something to do;
break;
case 1:
//something to do
break;
}https://stackoverflow.com/questions/9805482
复制相似问题