Set asp:RadioButtonList Repeat Layout (VB.net) : Radio Button List « Asp Control « ASP.Net






Set asp:RadioButtonList Repeat Layout (VB.net)

<%@ Page Language="vb" %>
<html>
<head>
   <title>Selection Control Example</title>
   <script runat="server">
      Sub Page_Load()
         MyCheckBox1.Checked = True
         MyRadioButton1.Checked = False
         MyListBox.SelectionMode = ListSelectionMode.Multiple
         MyDropDownList.SelectedIndex = 1
         MyCheckBoxList.RepeatDirection = RepeatDirection.Horizontal
         MyRadioButtonList.RepeatLayout = RepeatLayout.Table
      End Sub
   </script>
</head>
<body>
   <h1>Selection Control Example</h1>
   <form runat="server">
      <asp:table id="MyTable" border="1" cellpadding="5" cellspacing="0" runat="server">
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               CheckBox Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:checkbox id="MyCheckBox1" 
                  text="Vanilla" runat="server" />
               <asp:checkbox id="MyCheckBox2" 
                  text="Chocolate" runat="server" />
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               RadioButton Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:radiobutton id="MyRadioButton1" groupname="Group1" 
                  checked=True text="Yes" runat="Server"/>
               <asp:radiobutton id="MyRadioButton2" groupname="Group1"
                  text="No" runat="Server"/>
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               ListBox Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:listbox id="MyListBox" runat="server">
                  <asp:listitem value="Vanilla" selected="true">Vanilla</asp:listitem>
                  <asp:listitem value="Chocolate">Chocolate</asp:listitem>
                  <asp:listitem value="Strawberry">Strawberry</asp:listitem>
               </asp:listbox>
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               DropDownList Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:dropdownlist id="MyDropDownList" runat="server">
                  <asp:listitem value="Single" selected="true">Single</asp:listitem>
                  <asp:listitem value="Multiline">Multiline</asp:listitem>
                  <asp:listitem value="Password">Password</asp:listitem>
               </asp:dropdownlist>
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               CheckBoxList Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:checkboxlist id="MyCheckBoxList"
                  repeatdirection="vertical" runat="server">
                  <asp:listitem value="Vanilla" text="Vanilla"/>
                  <asp:listitem value="Chocolate" text="Chocolate"/>
                  <asp:listitem value="Strawberry" text="Strawberry"/>
               </asp:checkboxlist>
            </asp:tablecell>
         </asp:tablerow>
         <asp:tablerow runat="server">
            <asp:tablecell runat="server">
               RadioButtonList Control:
            </asp:tablecell>
            <asp:tablecell runat="server">
               <asp:radiobuttonlist id="MyRadioButtonList" repeatdirection="Horizontal" runat="server">
                  <asp:listitem value="Female" text="Female" selected="true"/>
                  <asp:listitem value="Male" text="Male"/>
               </asp:radiobuttonlist>
            </asp:tablecell>
         </asp:tablerow>
      </asp:table>
   </form>
</body>
</html>

           
       








Related examples in the same category

1.Get selected item, value and text from asp:RadioButtonList (VB.net)
2.On radiobutton list changed (VB.net)
3.Setting and Retrieving the Selected Item in a RadioButton Control Group (VB.net)
4.Select case for asp:radiobuttonlist (VB.net)
5.Get selected item value from asp:radiobuttonlist (VB.net)
6.Get selected radio button from radio button list (C#)
7.select case statement for asp:radiobuttonlist (C#)
8.Get selected value from asp:radiobuttonlist (C#)
9.Add ListItem to RadioButtonList
10.RadioButtonList Control