Asp net vb ListBox selected items
Ngày đăng:
27/12/2021
Trả lời:
0
Lượt xem:
217
asp.net listbox get multiple selected items The following asp.net c# example code demonstrate us how can we get ListBox control's selected items programmatically when ListBox selection mode is multiple. ListBox control 'SelectionMode' property have two possible values 'Multiple' and 'Single'. Multiple mode allow us to select more than one items from ListBox control. When users select items from ListBox which SelectionMode is Multiple, then it is more complicated to get the selected items programmatically at run time. We can get ListBox selected items on ListBox SelectedIndexChanged event or manually by a Button click without AutoPostBack. To get the ListBox selected items, at first we perform a Linq query to get the ListBox items which ListItem object's 'Selected' property value is 'true'. Then we loop through the selected items collection and display on web browser with items text and value.. listbox-get-multiple-selected-items.aspx
<%@ Page Language="C#" AutoEventWireup="true"%>
More asp.net examples
|