如题,想实现checkboxlist后面紧跟一个textbox,checkboxlist横向排列,并且设定了每行显示6个(如果是一行就不存在这个问题),肯定会有换行。设定Width也是不行的,这样其实就在是html中加上了 style="display:inline-block;width:600px;"类似这样的css代码,并且会产生列表项中间换行。 <asp:CheckBoxList ID="Interest" runat="server" RepeatDirection="horizontal" RepeatLayout="flow">
</asp:CheckBoxList>
<asp:TextBox ID="InterestOther" runat="server" CssClass="input1"></asp:TextBox>
暂时还不想使用html控件,求有没有解决办法
</asp:CheckBoxList>
<asp:TextBox ID="InterestOther" runat="server" CssClass="input1"></asp:TextBox>
暂时还不想使用html控件,求有没有解决办法
<table><tr><td>
<asp:CheckBoxList ID="Interest" runat="server" RepeatDirection="horizontal" RepeatLayout="flow">
</asp:CheckBoxList>
</td><td>
<asp:TextBox ID="InterestOther" runat="server" CssClass="input1"></asp:TextBox>
</td></tr></table>这知道你是不是要这样效果,这样是asp:TextBox 跟在asp:CheckBoxList 后面
<asp:ListItem Text="text1" />
<asp:ListItem Text="text2" />
</asp:CheckBoxList>
<asp:TextBox runat="server" />
3楼的,你用table把checkboxlist和textbox分成两列,如果checkboxlist的第二行没有满行,比如是第一行的一半,那你的布局可想而知,textbox肯定和前边的listitem项有半行的距离,那就不是紧跟了。
4楼的,你贴出的代码在2.0中就已经有了。
2楼的,用table的话,其实是把每个listitem放到了td中,这样还是我一开始说的,如果每个text的长度不一样,那么实际排列出的checkboxlist就连不到一起了。
style="display:inline-block;"
可以达到目的