ストアド プロシージャを使用してデータベースのデータにバインドする gridview があります。
以下は、上記のエラーが発生するコードの一部です。
[WebMethod]
public static string GetList(int pageIndex){
....
.....
cmd.Parameters.AddWithValue("@customerGroup", RadioButtonList2.SelectedValue); //Error here
....
....
}
グリッドビューには次のコードがあります。
<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>
選択したラジオ ボタンの値を取得してストアド プロシージャに渡すにはどうすればよいですか? ラインコードを削除すると、すべてが機能します。