62,046
社区成员
发帖
与我相关
我的任务
分享
[code=C#] protected void Page_Load(object sender, EventArgs e)
{
String []args ={ "a", "b" };
RadioButtonList1.DataSource = args;
RadioButtonList1.DataBind(); //绑定
RadioButtonList1.Items[0].Selected = true; //设定选中 //html
}
protected void Button1_Click(object sender, EventArgs e)
{
foreach (ListItem item in RadioButtonList1.Items)
{
if(item.Selected) //判断选中
Response.Write("<br>" + item.Text+item.Value );
}
}