I have a scenario I want to use a partial view but I'm having issues with it passing data to the controller. Here is a basic example of what I'm trying to do.
Objects:
- Customer
- Order
A Customer has an IList<Order>
on it. I want the partial view to allow the user to edit the information. I can get the data to display but when the form posts the list under the Customer object is null.
I have also attempted to use a seperate form in my partial view. When I do this if I create paramenters on the controller like so I get the data:
public ActionResult UpdateOrders(IList<Guid> id, IList<int> quantity, IList<Guid> productId)
But when I do this
public ActionResult UpdateOrders(IList<Order> orders)
The list is null.
If anyone has a better suggestion of how to achieve this let me know.