Here are examples: <%@ Page Language="C#" %> <html> <head> <title>Exercise</title> </head> <body> <form id="frmRealEstate" method="post" runat="server"> <asp:RadioButtonList id="Genders" runat="server"> <asp:ListItem>Male</asp:ListItem> <asp:ListItem>Female</asp:ListItem> <asp:ListItem>Unknown</asp:ListItem> </asp:RadioButtonList> </form> </body> </html> This would produce:
By default, the captions of the radio buttons are positioned on the right side of their round boxes. This characteristic is controlled by the TextAlign attribute of the RadioButtonList control and whose default value is Right. If you want the captions to be positioned to the left, assign the Left string to this attribute. Here is an example: <%@ Page Language="C#" %> <html> <head> <title>Exercise</title> </head> <body> <form id="frmRealEstate" method="post" runat="server"> <asp:RadioButtonList id="Genders" TextAlign="Left" runat="server"> <asp:ListItem>Male</asp:ListItem> <asp:ListItem>Female</asp:ListItem> <asp:ListItem>Unknown</asp:ListItem> </asp:RadioButtonList> </form> </body> </html> This would produce: |
|
|||
|