<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';
<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';
list.Items.Add(new ListItem("2", "日本"));
list.Items.Add(new ListItem("3", "美国"));list.items.selectValue自己参考 改进
{
if (this.RadioButton1.Checked == true)
{
Session["answer" + this.RadioButton1.ID] = "A";
}
} protected void Button1_Click(object sender, EventArgs e)
{
Response.Write(Session["answerRadioButton1"].ToString());
}