我得到這個錯誤,而試圖使用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