1
我想選擇ListBox
中的多個項目,但是瀏覽器要求用戶按下CTRL來選擇多個項目,否則它只會選擇一個項目。如何在ListBox中多次選擇項目,而無需在Asp.Net中按CTRL?
我想選擇多個項目而不按CTRL,但我不想使用CheckBoxList
。有沒有更好的方法來做到這一點?使用純JavaScript,或JQuery或Codebehind。
(我已經添加SelectionMode="Multiple"
屬性ListBox
控制)
代碼:
<asp:ListBox ID="ListBox1" runat="server" Height="210px" Width="203px" SelectionMode="Multiple">
<asp:ListItem>1000</asp:ListItem>
<asp:ListItem>2000</asp:ListItem>
<asp:ListItem>4000</asp:ListItem>
<asp:ListItem>4000</asp:ListItem>
<asp:ListItem>5000</asp:ListItem>
<asp:ListItem>6000</asp:ListItem>
</asp:ListBox>
檢查此鏈接[製作一個標準的ASP.NET列表框做多選不按住Ctrl](http://josephschrag.blogspot.in/2010/11/making-standard-aspnet-listbox-do。 html)。我剛剛嘗試過,併爲我完美地工作。 –
這個項目是否使用.NET Framework v2?在該框架的更高版本中,Multiple不需要ctrl併爲v2功能提供「擴展」。 –