读书人

C#菜RadioButtonList解决办法

发布时间: 2012-03-01 10:25:46 作者: rapoo

C#菜RadioButtonList
我想要RadioButtonList有3
RadioButtonList取料容示料
A
B
C

A判,接到A的面
B判,接到B的面

教各位大怎,

[解决办法]

C# code
<asp:RadioButtonList ID="rbl" runat="server" AutoPostBack="false" RepeatLayout="Table" OnSelectedIndexChanged="rbl_SelectedIndexChanged">    <asp:ListItem Value="1">A</asp:ListItem>    <asp:ListItem Value="2">B</asp:ListItem>    <asp:ListItem Value="3">C</asp:ListItem></asp:RadioButtonList>public int sel;protected void rbl_SelectedIndexChanged(object sender, EventArgs e){        sel = Convert.ToInt32(rbl.SelectedItem.Value);        swith(sel)        {              case 1:                      Response.Redirect("A.aspx");                      break;              case 2:                      Response.Redirect("B.aspx");                      break;              case 3:                      Response.Redirect("C.aspx");                      break;              default:                      break;        }} 

读书人网 >C#

热点推荐