title: MVC 4 DropDownList can't add to model
body: <p>Hi I am new to MVC 4 and have run into an error when trying to use Html.DropDownList.</p>
  
  <p>Here is my current code.</p>
  
  <p>Model for Jobs:</p>
  
  <pre><code>  namespace Payroll.CORE
    {
    public class Job
    {
       public int JobID { get; set; }
       public string JobTitle { get; set; }
  
      public virtual ICollection&lt;Employee&gt; Employees { get; set; }
    }
  }
  </code></pre>
  
  <p>Model for Employee:</p>
  
  <pre><code>    public int EmployeeID { get; set; }
      public string Name { get; set; }
      public string Surname { get; set; }
      public int PhoneNumber { get; set; }
      public int CellNumber { get; set; }
      public string Address1 { get; set; }
      public string Address2 { get; set; }
      public string City { get; set; }
      public int PostalCode { get; set; }
      public string BankName { get; set; }
      public int BankAccountNumber { get; set; }
      public string PayInterval { get; set; }
      public double NormalRate { get; set; }
      public double OvertimeRate { get; set; }
      public double SetHours { get; set; }
      public System.DateTime DateOfEmployment { get; set; }
      public System.DateTime LastPaymentRecieved { get; set; }
      public string Active { get; set; }
      public int JobID { get; set; }
  
      public virtual ICollection&lt;Absent&gt; Absents { get; set; }
      public virtual ICollection&lt;Bonus&gt; Bonuses { get; set; }
      public virtual Job Job { get; set; }
      public virtual ICollection&lt;Holiday&gt; Holidays { get; set; }
      public virtual ICollection&lt;HoursWorked&gt; HoursWorkeds { get; set; }
      public virtual ICollection&lt;Payrolls&gt; Payrolls { get; set; }
      public virtual ICollection&lt;Deduction&gt; Deductions { get; set; }
  </code></pre>
  
  <p>View:</p>
  
  <pre><code>     &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.JobID)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownList("ListSL")
  
      &lt;/div&gt;
  </code></pre>
  
  <p>Controller:</p>
  
  <pre><code>   [HttpGet]
      public ActionResult Create()
      {
  
          List&lt;SelectListItem&gt; jobs = new List&lt;SelectListItem&gt;();
          List&lt;Job&gt; list = bll.GetJobCatergories();
  
          foreach (var a in list)
          {
              jobs.Add(new SelectListItem { Text = a.JobTitle, Value = a.JobID.ToString()       });
          }
  
          ViewBag.ListSL = jobs;
          return View();
      }
  </code></pre>
  
  <p>I now have no way of getting the value of JobID into my model. I have tried using @Html.DropDownListFor but cant get it to populate with the SelectListItem.</p>
  
  <p>I really have no problem getting it to work with hiddenfields or anything so any help would be greatly appreciated. </p>
  
  <p>Thanks in Advance. </p>
  
  <p>Edit:
  Sorry should have been a bit more clear.  I am creating an employee and the employee gets assigned a job.So I am trying to add the selected Items list value  to the Value int JobID in Employee.</p>
  
  <p>Also the values are showing in the dropdownlist, I need to add the selected value to the employee model when submitting.</p>