通过FindControl(单选按钮ID),找到控件后,判断checked属性

解决方案 »

  1.   

    this.RadioButton1.Checked = true  选中
      

  2.   

            for (int i = 0; i < RadioButtonList1.Items.Count; i++)
                if (RadioButtonList1.Items[i].Selected)
                    Response.Write("你选中了第" + (i+1).ToString() + "项");
      

  3.   

    用for循环,代码如下:for (int i = 0; i < RadioButtonList1.Items.Count; i++) 
    {
       if (RadioButtonList1.Items[i].Selected) 
       {
          Response.Write("你选中了第" + (i+1).ToString() + "项");
       }
    }
      

  4.   


     if (RadioButtonList1.SelectedIndex != -1)
            {
                Response.Write(RadioButtonList1.SelectedItem.Text);
            }
            else
            {
                Response.Write("请选择");
            }
      

  5.   


     if (RadioButtonList1.SelectedIndex != -1)
            {
                Response.Write(RadioButtonList1.SelectedItem.Text);
            }
            else
            {
                Response.Write("请选择");
            }