3. FrmRadioButtonList.aspx 페이지에 다음과 같이 입력한다. 라디오버튼리스트 컨트롤도 체크박스리스트 컨트롤과 마찬가지로 ListItem 컨트롤을 사용해 항목을 하나 이상 추가할 수 있다. 라디오버튼리스트 컨트롤의 RepeatDirection 속성 값을 Horizontal로 설정하면 가로로 나열되고, Vertical로 설정하면 세로로 나열된다.

    ▼  FrmRadioButtonList.aspx

    <%@ Page Language=“C#” AutoEventWireup=“true” CodeBehind=“FrmRadioButtonList.aspx.cs”
      Inherits=“DevStandardControl.FrmRadioButtonList” %>
    
    <!DOCTYPE html>
    
    <html xmlns=http://www.w3.org/1999/xhtml">
    <head runat=“server”>
    <meta http-equiv=“Content-Type” content=“text/html; charset=utf-8”/>
      <title>라디오버튼리스트 컨트롤</title>
    </head>
    <body>
      <form id=“form1” runat=“server”>
      <div>
          <asp:RadioButtonList ID=“lstWedding” runat=“server” RepeatDirection=“Horizontal”>
              <asp:ListItem Selected=“True”>미혼</asp:ListItem>
              <asp:ListItem>기혼</asp:ListItem>
          </asp:RadioButtonList>
          <asp:Button ID=“btnOK” runat=“server” Text=“확인” OnClick=“btnOK_Click” />
      </div>
      </form>
    </body>
    </html>
    

    신간 소식 구독하기
    뉴스레터에 가입하시고 이메일로 신간 소식을 받아 보세요.