我的RadioButton是动态的
前台: <asp:RadioButton ID="RadioButton1" Text='<%#Eval("Iid")%>' runat="server" />
但是后台我的RadioButton 是动态生成的,但是asp.net中的RadioButton 不带有互斥,怎么样才能让这个动态的RadioButton 互斥呢? 求解,谢谢
前台: <asp:RadioButton ID="RadioButton1" Text='<%#Eval("Iid")%>' runat="server" />
但是后台我的RadioButton 是动态生成的,但是asp.net中的RadioButton 不带有互斥,怎么样才能让这个动态的RadioButton 互斥呢? 求解,谢谢
后台动态生成的保持跟他一样的属性
GroupName="123
{
if (aa > 1)
{
System.Web.UI.WebControls.CheckBox ck = (System.Web.UI.WebControls.CheckBox)item.FindControl("CheckBox1");
if (ck.Checked && n <= aa)
{
vs.insert(Convert.ToInt32(ck.Text), userid);
n++;
}
}
else
{
System.Web.UI.WebControls.RadioButton check = (System.Web.UI.WebControls.RadioButton)item.FindControl("RadioButton1");
if (check.Checked && n <= aa)
{
vs.insert(Convert.ToInt32(check.Text), userid);
n++;
}
}
}我的RadioButton 是放在Repeater里面的
{ }
在这个事件里试试
<asp:RadioButton groupname=“aa” ID="RadioButton1" Text=' <%#Eval("Iid")%>' runat="server" /> 这样写上不行吗?