0
我有一个使用存储过程与数据库中的数据绑定的gridview。非静态字段,方法或属性需要对象引用'_Default.RadioButtonList2'
下面是落后在那里我得到上述错误的部分代码:
[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>
我如何获得的单选按钮的值选择并传递给存储过程? 当我删除行代码时,一切正常。