Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Post array in ASP.NET MVC 2 using name="array_name[]" for form elements

Good day!

In PHP it is possible to assign name attribute to input elements with square brackets, like this: name="my_value[]" and PHP automagically converts this to array on server side.

Is this possible in ASP.NET MVC? If not is there any alternative to process a bunch of checkboxes in ASP.NET MVC?

Thanks in advance!

like image 934
artvolk Avatar asked Feb 02 '11 07:02

artvolk


1 Answers

Yes, it is possible. You might take a look at the following blog post about the convention used by the default model binder.

like image 185
Darin Dimitrov Avatar answered Sep 23 '22 20:09

Darin Dimitrov