I have one view with the following info
- Company Info
- List of Company Address
- List of Company User
For Company Info, I design with @Html.TextBoxFor(model => model.SingleClient.CompanyNameEN)
and other info are the same
For List of Company Address, I use
@foreach (ClientAddress u in Model.List_ClientAddress)
{
<td>@Html.EditorFor(model => u.Director)</td>
}
For List of Company User, I use the same as Company Address.
My question is I have no idea how to send back all value ( Update Company info, Company Address List, Company User Info to Controller.
Noted:
I use @using(Html.BeginForm("UpdatePost", "Company", FormMethod.Post))
... button submit inside
In Controller Index Controller
viewCollection collection = new viewCollection();
collection.SingleClient = gen.list_of_client().ToList().Where(x => x.ClientCode == client).FirstOrDefault();
collection.List_CompanyAddress = gen.List_of_CompanyAddress().Where(x => x.ClientCode == client).ToList();
collection.List_ClientUser = gen.List_of_ClientUser().Where(x => x.ClientCode == client).ToList();
return View(collection);
Update Controller
collection.SingleClient.CompanyNameEN; //Return Null
collection.SingleClient.CompanyNameKH // Return NUll
List<ClientAddress> cadd = collection.List_ClientAddress;(Return Null)
List<ClientSharedHolder> csh = collection.List_ClientShared; (Return Null)
So Please help to advice me how to solve this problem? as I have no idea about this.