我有一个ASP ListBox,其SelectionMode设置为"多个".是否有任何方法可以检索所有选定的元素,而不仅仅是最后一个元素?
<asp:ListBox ID="lstCart" runat="server" Height="135px" Width="267px" SelectionMode="Multiple"></asp:ListBox>
Run Code Online (Sandbox Code Playgroud)
使用lstCart.SelectedIndexjust返回最后一个元素(如预期的那样).有什么东西可以让我全部被选中吗?
这是一个Web表单.