限制asp.net中CheckedListBox中显示的项目数
我在asp.net web表单页中有一个checkedlistbox,如下所示:限制asp.net中CheckedListBox中显示的项目数,asp.net,webforms,checkboxlist,Asp.net,Webforms,Checkboxlist,我在asp.net web表单页中有一个checkedlistbox,如下所示: <asp:CheckBoxList ID="TagListCheckBox" runat="server" Height="100px" Width = "300px" style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left"> </asp:CheckBoxList> 但是列表框的高度会
<asp:CheckBoxList ID="TagListCheckBox" runat="server" Height="100px" Width = "300px"
style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left">
</asp:CheckBoxList>
但是列表框的高度会随着添加的项目数的增加而增加。我想限制要显示的项目数,并在列表框中添加一个滚动按钮或其他内容。我该怎么做?尝试在控件周围放置一个div,这应该可以做到:
<div style="width:200px; height:100px; overflow:auto;">
<asp:CheckBoxList ID="TagListCheckBox" runat="server" Width="300px"
style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left">
</asp:CheckBoxList>
</div>
试着在你的控件周围放置一个div,这应该可以做到:
<div style="width:200px; height:100px; overflow:auto;">
<asp:CheckBoxList ID="TagListCheckBox" runat="server" Width="300px"
style="z-index: 1; left: 63px; top: 146px; position: absolute; TextAlign="Left">
</asp:CheckBoxList>
</div>
可能的重复可能的重复