ASP.NET SelectionMode Property

Definition and Usage

The SelectionMode property is used to get or set the way the user selects items in the ListBox.

Syntax

<asp:ListBox SelectionMode="mode" runat="server">
some content
</asp:ListBox>
Property Description
mode

Specify the way the user selects items in the ListBox.

Possible values:

  • Single - Default. Multiple items cannot be selected.
  • Multiple - Select multiple items.

Example

The following example sets the SelectionMode property of the ListBox control:

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

Example

Set the SelectionMode of ListBox Control