我得到这个错误,而试图使用VB代码禁用单选按钮列表上的第一个单选按钮的大小:指数超出范围。必须为非负且小于集合参数
RadioButtonList1.Items(0).Enabled = False
下面是ASPX代码
<td class="TDLR">
<asp:RadioButtonList ID="RadioButtonList1" runat="server" DataSourceID="SqlFollow" DataTextField="FollowDesc" DataValueField="FollowID">
</asp:RadioButtonList>
<asp:SqlDataSource ID="SqlFollow" runat="server"
ConnectionString="<%$ ConnectionStrings:SampleConnectionString %>"
SelectCommand="Select FollowID, FollowDesc FROM FollowUp WHERE FollowID > 30">
</asp:SqlDataSource>
</td>
该错误表明您正试图在RadioButtonList被填充之前设置Enabled值。验证你的select语句返回一个值。另外,你在哪里设置启用值? – AWinkle
此外,你有'ViewState'打开?这也会稍微修改流量。 –
谢谢。对不起,编程有点新意。我打算禁用网格上的第一个单选按钮。任何帮助请。 – user3199339