Posting lists in your model back to the controller
I have not been able to find a good example of a model that contains a list that you pass to your view, then pass it back to the controller when the user posts. I have lots of examples of passing back a 'selected' item in a listboxfor, but no example where I can persist the entire list in the model back to the controller.
I have searched far and wide and have come up short. If someone can point me to a good example, I would greatly a开发者_JS百科ppreciate it.
You need to make sure your items are in inputs that will get posted back to the server and in sequential order - see: http://haacked.com/archive/2008/10/23/model-binding-to-a-list.aspx
Also - you could retrieve your own objects and send them over in a call to jQuery.post as your data parameter as well.
精彩评论