title: Pass Complex Model in Post Method of Asp.net MVC
body: <p>In my Razor View, I have candidate details along with other Degrees etc. I have to append row of Candidate's degree. I have taken Degree View as a partial view. Which will be added by candidate according to the number of degree he has. I need to pass detail of degree along with other details of Candidate to controller. I have attached my UI and details here:- </p>
  
  <p>Here is my Model</p>
  
  <pre><code> public class Candidate:BaseEntity
  {
      public Candidate()
      {         
  
          CandidateDegreeMap = new HashSet&lt;CandidateDegreeMap&gt;();                  
      }
      public string FirstName { get; set; }
      public string LastName { get; set; }
      public string PhoneNo { get; set; }
      public string Email { get; set; }
      public string Status { get; set; }
      public string Gender { get; set; }
      public DateTime Dob { get; set; }
      public DateTime DateCreated { get; set; }
      public int CreatedBy { get; set; }
      public DateTime? DateModified { get; set; }
      public int? ModifiedBy { get; set; }
      public bool IsDeleted { get; set; }   
  
      public ICollection&lt;CandidateDegreeMap&gt; CandidateDegreeMap { get; set; }
  
  }  
  </code></pre>
  
  <p>I need to pass candidate details with their multiple Education. 
  Here I am Adding my controller </p>
  
  <pre><code>[HttpPost]
      public async Task&lt;IActionResult&gt; AddEdit([FromBody]CandidateModel model, 
  string returnUrl = null)
      {
          return await Task.Run(()=&gt;View("AddCandidate",model));
      }
  </code></pre>
  
  <p>My View is below </p>
  
  <pre><code>/*Dashboard Page Ends*/
  </code></pre>
  
  <pre class="lang-html prettyprint-override"><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  &lt;head&gt;
      &lt;meta charset="utf-8" /&gt;
      &lt;meta name="viewport" content="width=device-width, initial-scale=1.0" /&gt;
      &lt;title&gt;AddCandidate - CVManagement&lt;/title&gt;
      &lt;link href="https://fonts.googleapis.com/icon?family=Material+Icons" rel="stylesheet"&gt;
      &lt;link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/css/materialize.min.css" /&gt;
      &lt;link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Nunito"&gt;
      &lt;link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css"&gt;
      &lt;link rel="stylesheet" href=/css/select2.min.css /&gt;
      &lt;link rel="stylesheet" href=/css/style.css /&gt;
      &lt;link rel="stylesheet" href=/css/responsive.css /&gt;
  &lt;/head&gt;
  &lt;body class="dashboard-body"&gt;
      &lt;nav class="dashboard-nav"&gt;
          &lt;div class="container"&gt;
              &lt;div class="nav-wrapper"&gt;
                  &lt;a class="brand-logo" href="/Home/Index"&gt;&lt;img src="/images/login/logo.png"&gt;&lt;/a&gt;
                  &lt;ul id="nav-mobile" class="right hide-on-med-and-down"&gt;
                      &lt;li&gt;
                          &lt;a href="/Home/Index"&gt;&lt;img src="/images/dashboard/search.png"&gt;&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li&gt;
                          &lt;a href="/Home/Index"&gt;&lt;img src="/images/dashboard/notification.png"&gt;&lt;/a&gt;
                      &lt;/li&gt;
                      &lt;li&gt;
                          &lt;a class='dropdown-button' data-activates='dropdownUser' href="/Home/Index"&gt;&lt;img src="/images/dashboard/myaccount.png" width="40"&gt; &lt;mp&gt;John Doe&lt;/mp&gt; &lt;span class="material-icons"&gt;arrow_drop_down&lt;/span&gt;&lt;/a&gt;
                      &lt;/li&gt;
                  &lt;/ul&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/nav&gt;
      &lt;div class="sub-menu"&gt;
          &lt;div class="container"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col l2"&gt;
                      &lt;a href="#!" class="active"&gt;&lt;img src="/images/dashboard/dashboard_icon.png"&gt; Dashboard&lt;/a&gt;
                  &lt;/div&gt;
                  &lt;div class="col l2"&gt;
                      &lt;a href="#!"&gt;&lt;img src="/images/dashboard/candidates_normal.png"&gt; Candidates&lt;/a&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="container"&gt;
  
  &lt;div class="dashboard-breadcrumb-menu"&gt;
      &lt;a href="#!" class="breadcrumb breadcrumb-slash dashboard-breadcrumb"&gt;Dashboard&lt;/a&gt;
      &lt;a href="#!" class="breadcrumb breadcrumb-slash dashboard-breadcrumb second"&gt;Openings&lt;/a&gt;
      &lt;a class="breadcrumb dashboard-breadcrumb-active"&gt;Add Candidate&lt;/a&gt;
  &lt;/div&gt;
  &lt;h5 class="title"&gt;Candidate Details&lt;/h5&gt;
  &lt;form method="post" class="col s12 m12 l12 xl12" action="/Candidate/AddEdit"&gt;
      &lt;div class="add-cnd-div form-div"&gt;
          &lt;h5 class="details-title"&gt;Personal&lt;/h5&gt;
          &lt;div class="row"&gt;
              &lt;div class="input-field col s12 m4"&gt;
                  &lt;input id="first_name" type="text" name="FirstName" value=""&gt;
                  &lt;label class="active" for="FirstName"&gt;First Name&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12 m4"&gt;
                  &lt;input id="last_name" type="text" name="LastName" value=""&gt;
                  &lt;label for="last_name"&gt;Last Name&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12 m4"&gt;
                  &lt;input id="Dob" class="cv-date-picker" type="text" data-val="true" data-val-required="The Dob field is required." name="Dob" value=""&gt;
                  &lt;label for="Dob"&gt;Date of Birth&lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="row"&gt;
              &lt;div class="input-field col s12 m4 gender-div"&gt;
                  &lt;img id="maleGenImg" data-gender="Male" src="/images/add_candidate/male_select.png"&gt;
                  &lt;img id="femaleGenImg" data-gender="Female" src="/images/add_candidate/female_deselect.png"&gt;
                  &lt;input id="Gender" type="text" disabled="disabled" name="Gender" value=""&gt;
                  &lt;label id="genderLbl" for="Gender"&gt;Gender&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12 m4"&gt;
                  &lt;input id="phone_number" type="text" name="PhoneNo" value=""&gt;
                  &lt;label for="PhoneNo"&gt;Phone Number&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12 m4"&gt;
                  &lt;input id="email" type="email" name="Email" value=""&gt;
                  &lt;label for="Email"&gt;Email&lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
      &lt;/div&gt;
  
      &lt;div class="add-cnd-div form-div"&gt;
          &lt;h5 class="details-title"&gt;Education&lt;/h5&gt;
          &lt;div id="education_container"&gt;
  
  &lt;div class="row education-div"&gt;
      &lt;div class="input-field col s12 m4"&gt;
          &lt;input type="text" id="DegreeName" name="DegreeName" value=""&gt;
          &lt;label for="DegreeName"&gt;Degree&lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="input-field col s12 m4"&gt;
          &lt;input type="text" id="InstituteName" name="InstituteName" value=""&gt;
          &lt;label for="InstituteName"&gt;Institute&lt;/label&gt;
      &lt;/div&gt;
      &lt;div class="input-field col s12 m4"&gt;
          &lt;input class="cv-date-picker" type="text" id="YearOfPassing" name="YearOfPassing" value=""&gt;
          &lt;label for="YearOfPassing"&gt;Year Of Passing&lt;/label&gt;
      &lt;/div&gt;
  &lt;/div&gt;
  
  
          &lt;/div&gt;
          &lt;div class="right-align"&gt;
              &lt;a class="add-more" href="#!" id="add_more_education"&gt;+ &lt;span&gt;Add more&lt;/span&gt;&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="add-cnd-div form-div"&gt;
          &lt;h5 class="details-title"&gt;Proffessional&lt;/h5&gt;
  
          &lt;div class="row"&gt;
              &lt;div class="input-field col s12 m6"&gt;
                  &lt;input id="tot_exp" type="text"&gt;
                  &lt;label for="tot_exp"&gt;Total Experience&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12 m6"&gt;
                  &lt;input id="rel_exp" type="text"&gt;
                  &lt;label for="rel_exp"&gt;Relevant Experience&lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
  
          &lt;div class="row"&gt;
              &lt;a href="javascript:;" class="add-work" id="add_work"&gt;&lt;img class="plus-img modal-trigger" data-target="modalCO" src="img/candicate_listing/plus.png"&gt; &lt;span&gt;Add Wrok Experience&lt;/span&gt;&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div id="job_container"&gt;
          &lt;div class="add-cnd-div form-div job-div"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col s12 m6"&gt;
                      &lt;input type="checkbox" class="filled-in" id="currentJob_1" /&gt;
                      &lt;label for="currentJob_1"&gt;Current Job&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="row"&gt;
                  &lt;div class="input-field col s12 m4 gender-div"&gt;
                      &lt;input id="employer_1" type="text"&gt;
                      &lt;label for="employer_1"&gt;Employer&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4"&gt;
                      &lt;input id="job_role_1" type="text"&gt;
                      &lt;label for="job_role_1"&gt;Job Role&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4 multisel-div"&gt;
                      &lt;select id="it_skills_1" class="material-select"&gt;
                          &lt;option value="1"&gt;Option 1&lt;/option&gt;
                          &lt;option value="2"&gt;Option 2&lt;/option&gt;
                          &lt;option value="3"&gt;Option 3&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;label&gt;IT Skills&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="row"&gt;
                  &lt;div class="input-field col s12 m4 gender-div"&gt;
                      &lt;div class="col s6 div-from"&gt;
                          &lt;input type="text" placeholder="Start" class="cv-date-picker"&gt;
                      &lt;/div&gt;
                      &lt;div class="col s6 div-to"&gt;
                          &lt;input type="text" placeholder="End" class="cv-date-picker"&gt;
                      &lt;/div&gt;
                      &lt;label class="date-range-lbl"&gt;Date Range&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4"&gt;
                      &lt;input id="current_ctc_1" type="text"&gt;
                      &lt;label for="current_ctc_1"&gt;Current CTC&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4 multisel-div"&gt;
                      &lt;input id="expected_ctc_1" type="text"&gt;
                      &lt;label for="expected_ctc_1"&gt;Expected CTC&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;a href="#!" class="tooltipped del-a" data-position="bottom" data-delay="30" data-tooltip="Delete"&gt;&lt;i class="material-icons del-img"&gt;clear&lt;/i&gt;&lt;/a&gt;
          &lt;/div&gt;
  
          &lt;div class="add-cnd-div form-div job-div"&gt;
              &lt;div class="row"&gt;
                  &lt;div class="col s12 m6"&gt;
                      &lt;input type="checkbox" class="filled-in" id="currentJob_2" /&gt;
                      &lt;label for="currentJob_2"&gt;Current Job&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="row"&gt;
                  &lt;div class="input-field col s12 m4 gender-div"&gt;
                      &lt;input id="employer_2" type="text"&gt;
                      &lt;label for="employer_2"&gt;Employer&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4"&gt;
                      &lt;input id="job_role_2" type="text"&gt;
                      &lt;label for="job_role_2"&gt;Job Role&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4 multisel-div"&gt;
                      &lt;select id="it_skills_2" class="material-select"&gt;
                          &lt;option value="1"&gt;Option 1&lt;/option&gt;
                          &lt;option value="2"&gt;Option 2&lt;/option&gt;
                          &lt;option value="3"&gt;Option 3&lt;/option&gt;
                      &lt;/select&gt;
                      &lt;label&gt;IT Skills&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="row"&gt;
                  &lt;div class="input-field col s12 m4 gender-div"&gt;
                      &lt;div class="col s6 div-from"&gt;
                          &lt;input type="text" placeholder="Start" class="cv-date-picker"&gt;
                      &lt;/div&gt;
                      &lt;div class="col s6 div-to"&gt;
                          &lt;input type="text" placeholder="End" class="cv-date-picker"&gt;
                      &lt;/div&gt;
                      &lt;label class="date-range-lbl"&gt;Date Range&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4"&gt;
                      &lt;input id="current_ctc_2" type="text"&gt;
                      &lt;label for="current_ctc_2"&gt;Current CTC&lt;/label&gt;
                  &lt;/div&gt;
                  &lt;div class="input-field col s12 m4 multisel-div"&gt;
                      &lt;input id="expected_ctc_2" type="text"&gt;
                      &lt;label for="expected_ctc_2"&gt;Expected CTC&lt;/label&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;a href="#!" class="tooltipped del-a" data-position="bottom" data-delay="30" data-tooltip="Delete"&gt;&lt;i class="material-icons del-img"&gt;clear&lt;/i&gt;&lt;/a&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="add-cnd-div form-div"&gt;
          &lt;div class="row"&gt;
              &lt;div class="input-field col s12 multisel-div"&gt;
                  &lt;select id="capability" class="material-select"&gt;
                      &lt;option value="1"&gt;Option 1&lt;/option&gt;
                      &lt;option value="2"&gt;Option 2&lt;/option&gt;
                      &lt;option value="3"&gt;Option 3&lt;/option&gt;
                  &lt;/select&gt;
                  &lt;label&gt;Capability&lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="row comment-row"&gt;
          &lt;div class="col s12 m6 add-cnd-div form-div cr-1"&gt;
              &lt;h5 class="details-title"&gt;Recruiter Comment&lt;/h5&gt;
              &lt;div class="comment-btn-div"&gt;
                  &lt;span class="comment-btn"&gt;Good&lt;/span&gt;
                  &lt;span class="comment-btn"&gt;Bad Communication&lt;/span&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12"&gt;
                  &lt;textarea id="textarea1" class="materialize-textarea"&gt;&lt;/textarea&gt;
                  &lt;label for="textarea1"&gt;Comment&lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
          &lt;div class="col s12 m6 add-cnd-div form-div cr-2"&gt;
              &lt;h5 class="details-title"&gt;Hiring Manager Comment&lt;/h5&gt;
              &lt;div class="comment-btn-div"&gt;
                  &lt;span class="comment-btn"&gt;Good&lt;/span&gt;
                  &lt;span class="comment-btn"&gt;Bad Communication&lt;/span&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12"&gt;
                  &lt;textarea id="textarea1" class="materialize-textarea"&gt;&lt;/textarea&gt;
                  &lt;label for="textarea1"&gt;Comment&lt;/label&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  
      &lt;div class="add-cnd-div form-div"&gt;
          &lt;div class="row"&gt;
              &lt;div class="input-field col s12 m4"&gt;
                  &lt;select class="material-select"&gt;
                      &lt;option value="" disabled selected&gt;Choose your option&lt;/option&gt;
                      &lt;option value="1"&gt;Option 1&lt;/option&gt;
                      &lt;option value="2"&gt;Option 2&lt;/option&gt;
                      &lt;option value="3"&gt;Option 3&lt;/option&gt;
                  &lt;/select&gt;
                  &lt;label&gt;Capability&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12 m4"&gt;
                  &lt;select class="material-select"&gt;
                      &lt;option value="" disabled selected&gt;Choose your option&lt;/option&gt;
                      &lt;option value="1"&gt;Option 1&lt;/option&gt;
                      &lt;option value="2"&gt;Option 2&lt;/option&gt;
                      &lt;option value="3"&gt;Option 3&lt;/option&gt;
                  &lt;/select&gt;
                  &lt;label&gt;Opening&lt;/label&gt;
              &lt;/div&gt;
              &lt;div class="input-field col s12 m4 sc-btn-container"&gt;
                  &lt;button class="btn btn-cre-opn waves-effect active"&gt;Save&lt;/button&gt;
                  &lt;button class="btn btn-cre-opn waves-effect"&gt;Cancel&lt;/button&gt;
              &lt;/div&gt;
          &lt;/div&gt;
      &lt;/div&gt;
  &lt;input name="__RequestVerificationToken" type="hidden" value="CfDJ8K7NtNmNf5lJsh806e0aRPmUONXIh2RLjJ1oH6KtOEdcIrE95C_Obn7dzp3LNYv2Eof0VGrWukRpqxXnYDAJGverd0YJjhOSXeUEJZFmHpAnjwlJMAoTnrYn2ILawiFAHDDU6_ujcJ-blB1IsoYXRzk" /&gt;&lt;/form&gt;
  
          &lt;footer&gt;
              &lt;p&gt;&amp;copy; 2017 - Azilen Technology Pvt. Ltd&lt;/p&gt;
          &lt;/footer&gt;
      &lt;/div&gt;
      &lt;script src="https://ajax.googleapis.com/ajax/libs/jquery/3.2.1/jquery.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdnjs.cloudflare.com/ajax/libs/materialize/0.100.2/js/materialize.min.js"&gt;&lt;/script&gt;
      &lt;script src="https://cdn.datatables.net/1.10.10/js/jquery.dataTables.min.js"&gt;&lt;/script&gt;
      &lt;script src="/js/select2.full.min.js?v=FcVIknBiVRk5KLQeIBb9VQdtFRMqwffXyZ-D8q0gQro"&gt;&lt;/script&gt;
      &lt;script src="/js/main.js?v=so9tT4PzF8oB51eAj1XS9fKQucf_89tcPE9-sQ8bpns"&gt;&lt;/script&gt;
  
  
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  
  
  <p>Moreover Please find Image also 
  <a href="https://i.stack.imgur.com/k9WYC.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/k9WYC.png" alt="AddCandidate"></a></p>