how to pass ListBox values back to controller in ASP.NET MVC 2 without using ViewData .
I have a listbox on ASP.NET MVC View . When submitting form I want to pass ListBox values back to controller . How to achieve this using Jquery or Javascript?
how to pass ListBox values back to controller in ASP.NET MVC 2 without using
Share
Its very simple . Use FormCollection in your Parameter list of Action method in your controller and then create a String Array for your ListBox values in your model .
Now Assign
formvalue[“Your_ListBox_value”].Split(new char[] { ‘,’ }, StringSplitOptions.RemoveEmptyEntries);
to your newly created String Array in your Controller .