ListBox Server Control

ListBox Server Control

The ListBox server control has a function similar to the DropDownList control. It displays a collection of items. The ListBox control allows the user to make multiple selections from the collection.

Code for ListBox Server Control:

<asp:ListBox ID=”ListBox1″ runat=”server” SelectionMode=”Multiple”>
<asp:ListItem>Word 2013</asp:ListItem>
<asp:ListItem>Excel 2013</asp:ListItem>
<asp:ListItem>PowerPoint 2013</asp:ListItem>
<asp:ListItem>Computer Fundamentals</asp:ListItem>

You can use the SelectionMode attribute to make multiple selections from what is displayed on the ListBox or by selecting the SelectionMode property from the ListBox Property Window and click the “Multiple”option.
You can select multiple options also by pressing Ctrl Key.

Scroll to Top