How to: Add ListBox Web Server Controls to a Web Forms Page
The process of adding aWeb server control consists primarily of setting options for how items should be displayed and whether users can select multiple items.
To add a ListBox control to a Web Forms page
Type an <asp:ListBox> element onto the page(for syntax, see ListBox Web Server Control), and then set the following properties:
Set to specify how many items should be displayed at once.NoteYou can also set the property to a pixel value. If you do, it takes precedence over the value of the Rows property. However, not all browsers support the Height property, so you should set the Rows property also.
Set toor to specify how many items users can select.
Create items for the control in one of these ways:
By creating them as individual items. For details, see.
By data binding the control. For details, see.