Latest web development tutorials

ASP.NET ListBox SelectionMode property

ListBox Control ListBox Control

Definition and Usage

SelectionMode property is used to get or set the user to select the way ListBox items.

grammar

<asp:ListBox SelectionMode="mode" runat="server">
Some Content
</asp:ListBox>

属性 描述
mode 规定用户选择 ListBox 项目的方式。

可能的值:

  • Single - 默认。不能选择多个项目。
  • Multiple - 可选择多个项目。


Examples

The following examples set SelectionMode property of the ListBox control:

<form runat="server">
<asp:Calendar id="cal1" runat="server"
SelectionMode="Multiple" />
</form>

The demonstration >>

ListBox Control ListBox Control