我有一个gridview,我使用存储过程与数据库中的数据绑定。
下面是我得到上述错误的部分代码:
[WebMethod]
public static string GetList(int pageIndex){
....
.....
cmd.Parameters.AddWithValue("@customerGroup", RadioButtonList2.SelectedValue); //Error here
....
....
}
我有这个gridview的代码:
<asp:RadioButtonList ID="RadioButtonList2" runat="server" AutoPostBack="True"
Font-Size="1em" EnableViewState="true">
<asp:ListItem Value="1">Africa</asp:ListItem>
<asp:ListItem Value="2" >America</asp:ListItem>
<asp:ListItem Value="3">Europe</asp:ListItem>
<asp:ListItem Value="4">Asia/asp:ListItem>
<asp:ListItem Value="5">Australia</asp:ListItem>
</asp:RadioButtonList>
如何获取所选单选按钮的值并将其传递给存储过程?当我删除行代码时,一切正常。