Tuesday 15 September 2015

Get all selected items from asp.net ListBox -


Anyone knows an easy way to get selected items in the CatalogBox control extension Methods?

And, please let me argue that is irrelevant how to get such a list because in the end everything uses a loop to use an item and anyway the selected people Finds

  var selected = yourListBox.Items.GetSelectedItems (); // var selected = yourDropDownList.Items.GetSelectedItems (); // var selected = yourCheckBoxList.Items.GetSelectedItems (); // var selected = yourRadioButtonList.Items.GetSelectedItems (); Public Static Class Extensions {Public Fixed IEnumerable & lt; ListItem & gt; GetSelectedItems (this ListItemCollection item) {return items. Optty Type & lt; ListItem & gt; (). Where (item => items selected); }}  

No comments:

Post a Comment