I'm having trouble forwarding my model to the control:
Class:
public class Pessoa { public virtual long Id {get; set;} public virtual string Nome {get; set;} public virtual ETipo Tipo {get; set;} public virtual List ListaClientes {get; set;} }
View:
@using Projeto.Model.Enum @model projeto.Model.Cadastro.Pessoa @{ title = ".." List lstCliente = Model.ListaClientes; } @using (Ajax.BeginForm("SalvaPessoa", "Home", new AjaxOptions { HttpMethod = "POST"})) { @Html.Hidden(m => m.Id) @Html.Hidden(m => m.Nome) @Html.Hidden(m => m.Tipo) @foreach(var x in @lstCliente){ Cliente @Html.CheckboxFor(m => m.ListaClientes.IsAtivo, new{ class = "form"}) } Salvar }
Controller:
public JsonResult SalvaPessoa(Pessoa model){ ... }
So, all the fields are coming right on my (), except for my list whose changed the IsActive bool inside the form;
All fields are valued, even the list already comes from my ActionResult () Valued.
Can anyone help me with how to make this my list is sent along to the PersonalSave ()?