62,047
社区成员
发帖
与我相关
我的任务
分享
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:RadioButtonList ID="RadioButtonList1" runat="server">
<asp:ListItem Selected="true" Text="radio1"></asp:ListItem>
<asp:ListItem Text="radio2"></asp:ListItem>
<asp:ListItem Text="radio3"></asp:ListItem>
<asp:ListItem Text="radio4"></asp:ListItem>
<asp:ListItem Text="radio5"></asp:ListItem>
<asp:ListItem Text="radio6"></asp:ListItem>
<asp:ListItem Text="radio7"></asp:ListItem>
</asp:RadioButtonList>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /></div>
</form>
</body>
</html>
protected void Button1_Click(object sender, EventArgs e)
{
Response.Write( RadioButtonList1.SelectedItem.Text);
}