追加する必要がある項目のラジオ ボタン リストがあります。Page_Load
aspx コード
<asp:radioButtonList ID="radio1" runat="server" RepeatLayout="Flow" RepeatDirection="Horizontal">
</asp:radioButtonList>
コードビハインド
protected void Page_Load(object sender, EventArgs e)
{
RadioButtonList radioList = (RadioButtonList)Page.FindControl("radio1");
radioList.Items.Add(new ListItem("Apple", "1"));
}
制御が到達した後radioList.Items.Add
Object reference not set to instance of an object
エラーが発生し続けます
私は何を間違っていますか?