默認情況下,RadioButtonList、CheckBoxList 的各項是一行一個,豎着顯示的,如何讓其橫着顯示呢,設置 RepeatDirection 為 RepeatDirection.Horizontal就可以達到想要的結果。
<html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <fieldset> <legend>系統管理</legend> <asp:CheckBoxList ID="cblSystem" runat="server" AutoPostBack="false" RepeatColumns="4" RepeatDirection="Horizontal"> </asp:CheckBoxList> </fieldset> <div> </body> </html>
顯示的樣式如下:
