Findcontrol获取的控件为空
int an1=0;
int bn1=0;
int d1= 0;
string s1="";
for (int i = 1; i <= 41; i=i+4)
{
string rblname = "RadioButtonList" + i.ToString();
RadioButtonList rbl =(this.FindControl(rblname) as RadioButtonList);
if (rbl.SelectedValue == "a") an1=an1+1;
else bn1++;
}
<asp:RadioButtonList ID="RadioButtonList1" runat="server" RepeatDirection="Horizontal">
<asp:ListItem Value="a"> (a) 试试看</asp:ListItem>
<asp:ListItem Value="b">(b) 深思熟虑</asp:ListItem>
</asp:RadioButtonList>
rbl总是为null