title: Binding SelectedItem from dropdownlist to model object in MVC 4
body: <p>I'm very new with MVC, so bear with me, but I can't seem to bind a value from a SelectList to an instance of the selected object during a postback in MVC 4.</p>
  
  <p>Suppose I have to create a Teacher as a member of a School. I have a ViewModel class defined as such:</p>
  
  <pre><code>public class RegisterTeacherModel
  {
      [Required]
      [Display(Name = "User name")]
      public string UserName { get; set; }
  
      [Required]
      [DataType(DataType.EmailAddress)]
      [Display(Name = "Email address")]
      public string Email { get; set; }
  
      [Required]
      [Display(Name = "School")]
      public School SelectedSchool { get; set; }
  
      [ScaffoldColumn(false)]
      public Guid UserId
      {
          get;
          set;
      }
  
      public SelectList PossibleSchools
      {
          get;
          private set;
      }
  
      public RegisterTeacherModel(IRepository&lt;School&gt; schoolRepo)
      {
          PossibleSchools = new SelectList(schoolRepo, "Id", "Name");
      }
  }
  </code></pre>
  
  <p>And my View:</p>
  
  <pre><code>@using (Html.BeginForm()) {
  @Html.ValidationSummary(true)
  
  &lt;fieldset&gt;
      &lt;legend&gt;RegisterTeacherModel&lt;/legend&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.UserName)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.Email)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.EditorFor(model =&gt; model.Email)
          @Html.ValidationMessageFor(model =&gt; model.Email)
      &lt;/div&gt;
  
      &lt;div class="editor-label"&gt;
          @Html.LabelFor(model =&gt; model.SelectedSchool)
      &lt;/div&gt;
      &lt;div class="editor-field"&gt;
          @Html.DropDownListFor(model =&gt; model.SelectedSchool, Model.PossibleSchools)
      &lt;/div&gt;
      &lt;p&gt;
          &lt;input type="submit" value="Create" /&gt;
      &lt;/p&gt;
  &lt;/fieldset&gt;
  }
  </code></pre>
  
  <p>And finally, my Controller method:</p>
  
  <pre><code>    [HttpPost, ActionName("Create")]
      public ActionResult CreateTeacher(RegisterTeacherModel teacherModel)
      {
          if (ModelState.IsValid)
          {
              try
              {
                ...
              }
           }
      }
  </code></pre>
  
  <p>But when I receive the RegisterTeacherModel object back in my Create method in the Controller, SelectedSchool is always null. I must be missing something in the way the model binder re-creates the object references on postback. Can anyone point me in the right direction?</p>