我有一个列表框与选择模式的倍数。在后面的代码中,我想设置一些选定的值。这些值存在于ListItems [],名为'Names'。如何在ListBox中设置多个项目?
HTML代码:
<asp:ListBox ID="lbto" class="chosen" runat="server" Width="450px"
Height="20px" SelectionMode="Multiple">
<asp:ListItem>Mandy</asp:ListItem>
<asp:ListItem>Amit</asp:ListItem>
<asp:ListItem>sundar</asp:ListItem>
<asp:ListItem>ragu</asp:ListItem>
<asp:ListItem>raju</asp:ListItem>
</asp:ListBox>
列表项[]名称包含'肉酱'和'拉朱'。现在,当页面加载时,列表框应包含'ragu'和'raju'作为选定值。
你的答案是单列表项正确.. – ragu 2013-04-11 08:30:43
可以设置多个项目以上述方法“选择”。更新了答案。 – Carsten 2013-04-11 08:32:17
如果'lbto'包含100个项目意味着,它将检查整个100个项目。它需要更多时间吗? – ragu 2013-04-11 08:49:27