How do I get all values from a listbox that are not selected in ASP.NET MVC

Posted by Nick Reeve on Stack Overflow See other posts from Stack Overflow or by Nick Reeve
Published on 2010-04-21T16:06:20Z Indexed on 2010/04/22 0:33 UTC
Read the original article Hit count: 311

Filed under:
|
|

Hello,

I have a form that (amongst other things) contains 2 multi-select listboxes. Basically you can add items to the one on the right from the full list of items on the left using some add/remove buttons.

The problem is that I cannot see a way of picking up the contents of the listbox when posting back to the controller.

I have followed this example: http://ittecture.wordpress.com/2009/04/30/tip-of-the-day-198-asp-net-mvc-listbox-controls/

This works fine if you have actually selected the items in the listbox before posting. That's not really the way I think this UI should behave though.

Hope that makes sense, Nick

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about listbox