RadioButtonList1
怎样判断RadioButtonList中的项是否选中 --------------------编程问答-------------------- 通过FindControl(单选按钮ID),找到控件后,判断checked属性 --------------------编程问答-------------------- this.RadioButton1.Checked = true 选中 --------------------编程问答-------------------- for (int i = 0; i < RadioButtonList1.Items.Count; i++)if (RadioButtonList1.Items[i].Selected)
Response.Write("你选中了第" + (i+1).ToString() + "项"); --------------------编程问答-------------------- 用for循环,代码如下:
--------------------编程问答--------------------
for (int i = 0; i < RadioButtonList1.Items.Count; i++)
{
if (RadioButtonList1.Items[i].Selected)
{
Response.Write("你选中了第" + (i+1).ToString() + "项");
}
}
--------------------编程问答--------------------
if (RadioButtonList1.SelectedIndex != -1)
{
Response.Write(RadioButtonList1.SelectedItem.Text);
}
else
{
Response.Write("请选择");
}
if (RadioButtonList1.SelectedIndex != -1)
{
Response.Write(RadioButtonList1.SelectedItem.Text);
}
else
{
Response.Write("请选择");
}
补充:.NET技术 , ASP.NET