Is there a way to post all items in a SelectList (multiselect) to the method of a controller? By default when I use a SelectList it will only post the selected items to the Form.
I have a couple of MultiSelect controls on a View. Using jQuery the user can move items from ListBox1 to ListBox2 and vice versa. When the form is posted I want to be able to determine all items that ended up in ListBox1. However when I evaluate Form[“ListBox1”] in my controller it will only provide me a comma delimited list of the SELECTED values – but I want ALL items in ListBox1. Not just the selected ones.
How can I get the View to post ALL items in ListBox1 and not just the selected ones?
You have to use javascript to select all the ListBox options then all of them will be send to your controller.
Please find this link to be helpfull.