I am new to asp.net MVC-4 and stuck up while retrieving data from view to controller in case of render single partial view twice on company/create.cshtml
My complex model is as follow.
public partial class Company
{
public int CCode { get; set; }
public string CName { get; set; }
public string Addr1 { get; set; }
public string Addr2 { get; set; }
public string City { get; set; }
public string Country { get; set; }
public string EmailID { get; set; }
public string Remarks { get; set; }
public CompanyContacts Contacts { get; set; }
public partial class CompanyContacts
{
public int refCCode_Company { get; set; }
public int SrNo { get; set; }
public string ContactPerson { get; set; }
public string Designation { get; set; }
public string Contact1 { get; set; }
public string Contact2 { get; set; }
public string EmailID { get; set; }
public string IsActive { get; set; }
}
}
where in the CompanyContact is partial view rendered twice in company/create.cshtml page.
"@model ProjectName.Models.Company" so that i can bind HTML control as follow. @HTML.TextBoxFor(model >= model.CompanyContact)
<div class="tab-pane fade" id="contacts">
<div class="col-md-6">
<p>
@Html.Partial("_LedgerContactsPartial")
</p>
</div>
<div class="col-md-6">
<p>
@Html.Partial("_LedgerContactsPartial")
</p>
</div>
</div>
while save the data, how do i pass two contact person details to controller.
Thanks in Adv.