<TR><TD width="35%" height="50">
<asp:RadioButton id=RadioButton1 runat="server"  GroupName="Sl" AutoPostBack="true"></asp:RadioButton>
</TD>
</TR>
<TR><TD width="35%" height="50">
<asp:RadioButton id=RadioButton2 runat="server"  GroupName="Sl" AutoPostBack="true"></asp:RadioButton>
</TD>
</TR>
<TR><TD width="35%" height="50">
<asp:RadioButton id=RadioButton3 runat="server"  GroupName="Sl" AutoPostBack="true"></asp:RadioButton>
</TD>
</TR>
<TR><TD width="35%" height="50">
<asp:RadioButton id=RadioButton4 runat="server"  GroupName="Sl" AutoPostBack="true"></asp:RadioButton>
</TD>
</TR>
我想写个事件,当点击单选按钮时实现
当选 a 时  Session["answer" + id] = 'a';
当选 b 时  Session["answer" + id] = 'b';
当选 c 时  Session["answer" + id] = 'c';
当选 d 时  Session["answer" + id] = 'd';               

解决方案 »

  1.   

    RadioButtonListlist.Items.Add(new ListItem("1", "中国"));
    list.Items.Add(new ListItem("2", "日本"));
    list.Items.Add(new ListItem("3", "美国"));list.items.selectValue自己参考 改进
      

  2.   

    写单击事件啊,然后在事件中写session
      

  3.   

     protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
            {
                if (this.RadioButton1.Checked == true)
                {
                    Session["answer" + this.RadioButton1.ID] = "A";
                }
            }        protected void Button1_Click(object sender, EventArgs e)
            {
                Response.Write(Session["answerRadioButton1"].ToString());
            }