我收到错误:对象引用未设置为对象的实例。这里是代码
<asp:radiobuttonlist id="JAN" runat="server">
<asp:listitem id="radL" runat="server" value="L" />
<asp:listitem id="radP" runat="server" value="P" />
</asp:radiobuttonlist>
后面的代码:
protected void RadGrid1_InsertCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)
{
try
{
GridEditableItem editedItem = e.Item as GridEditableItem;
RadioButtonList JAN = (RadioButtonList)editedItem.FindControl("JAN");
string GENDER = JAN.SelectedValue;
foreach (ListItem item in JAN.Items)
{
if (item.Selected)
{
GENDER = item.Value;
}
}
SqlConnection conn1 = BusinessTier.getConnection();
conn1.Open();
int flg = BusinessTier.SavePersonalInfo(conn1, 1,JAN.SelectedItem.Value,)
BusinessTier.DisposeConnection(conn1);