Apologies if the title is unclear.
I\'m trying to return my model from a form submit in ASP.NET MVC.
My question is nearly the same as this question, only di
See below code, this way you don't need to hide the role Id, also when you save the selected roles for the user, you don't need to loop through all roles to see which role is selected.
View
@foreach (Roles info in Model.UserRoles)
{
}
Action
[HttpPost]
public ActionResult CreateUsers(Model model, string[] selectedRoles)
{
//
}