We are using asp.net mvc and having trouble in selecting the list of approved orders.
the orders are approved by selecting the checkbox against each order.
eg..
Order id Product Is Approved
1 book (depends if the user selects checkbox or not)
2 pen (depends if the user selects checkbox or not)
so currently we are doing something like this: and want to know if there a better way of implementating
View:
our false (as generated by microsoft)
on Post in Controller action method:
we loop through the Orders (which is a list of Order object)
in response(order id) = true,false: then we select that order or else we dont select
but u see we want to avoid writing that logic in controller.
so any ideas ?
Recently I answered about similar problem:
ASP.NET MVC Checkbox Group
You could do it like that (it will be propable foreach loop):
Your post method will be:
and the model will be