ASP.NET2.0:RadioButtonList控件
body: <form id="form1" runat="server"> <div> <asp:RadioButtonList ID="RadioButtonList1" runat="server"> <asp:ListItem>163.com</asp:ListItem> <asp:ListItem>sina.com</asp:ListItem> <asp:ListItem>baidu.com</asp:ListItem> </asp:RadioButtonList></div> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> <asp:Label ID="Label1" runat="server"></asp:Label> </form> 事件: protected void Button1_Click(object sender, EventArgs e) { Label1.Text=RadioButtonList1.SelectedItem.Value; } |