I have been learning .MVC recently and am having trouble understanding how to process a viewmodel when posted back. I have followed the example here: http://www.shawnmclean.com/blog/2011/04/asp-net-mvc-multiple-check-boxes-in-an-array-or-list/#codesyntax_2 My problem is how do we handle the viewmodel when posted back so that a user is save with the correct roles? Do I have to manually pull the values out of the viewmodel and assign the selected roles to the user?
All help appreciated!
James
Yes, you have to. This is the code from the your link handling that.
The Action receives the ViewModel object and calls a Method in some UserService which does the actual work: