title: Object in ViewModel Null on Post MVC3
body: <p>I've looked pretty hard for an answer on this and I can't tell exactly what I'm doing wrong.</p>
  
  <p>I have a partial view with its own Model</p>
  
  <pre><code>@model ViewModels.NotificationPartialViewModel
  @if (Model.CurrentNotification != null)
  {
      &lt;input name="CurrentNotification" id="CurrentNotification" type="hidden" value="@Model.CurrentNotification"/&gt;
      @Html.HiddenFor(m =&gt; m.CurrentNotification.NotificationType)
      @Html.HiddenFor(m =&gt; m.CurrentNotification.NotificationStart)
      @Html.HiddenFor(m =&gt; m.CurrentNotification.NotificationEnd)
      @Html.HiddenFor(m =&gt; m.TimeZoneOffset, new { @class = "timeZoneOffset" })
      if (Model.CurrentNotification.NotificationType == Model.DowntimeKey)
      {
      &lt;div class="fieldList"&gt;
          &lt;fieldset&gt;
              &lt;legend&gt;@Resources.PageLabels.Legend_NotificationDowntime&lt;/legend&gt;
              &lt;div class="fieldWrapper"&gt;
                  &lt;div class="editor-label"&gt;@Html.Label(Resources.PageLabels.Label_StartNotification)&lt;/div&gt;
                  &lt;div class="editor-field newline-wrapper wide"&gt;
                      @Html.EditorFor(m =&gt; m.NotificationStartDateTime)
                      @Html.ValidationMessageFor(model =&gt; model.NotificationStartDateTime)
                  &lt;/div&gt;
                  &lt;div class="editor-field device"&gt;
                      &lt;input type="date" id="NotificationStartDateTime_DevicePicker" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
              &lt;div class="fieldWrapper"&gt;
                  &lt;div class="editor-label"&gt;@Html.Label(Resources.PageLabels.Label_EndNotification)&lt;/div&gt;
                  &lt;div class="editor-field newline-wrapper wide"&gt;
                      @Html.EditorFor(m =&gt; m.NotificationEndDateTime)
                      @Html.ValidationMessageFor(model =&gt; model.NotificationEndDateTime)
                  &lt;/div&gt;
                  &lt;div class="editor-field device"&gt;
                      &lt;input type="date" id="NotificationEndDateTime_DevicePicker" /&gt;
                  &lt;/div&gt;
              &lt;/div&gt;
          &lt;/fieldset&gt;
      &lt;/div&gt;
      }
      else if (Model.CurrentNotification.NotificationType == Model.HotfixKey)
      {       
      &lt;div class="fieldWrapper"&gt;
          &lt;div class="editor-label"&gt;
              &lt;label for="DisplayHotfixNotification"&gt;@Resources.PageLabels.Label_DisplayHotfix&lt;/label&gt;
          &lt;/div&gt;
          &lt;div class="editor-field"&gt;@Html.CheckBoxFor(m =&gt; m.DisplayHotfixNotification)&lt;/div&gt;
      &lt;/div&gt;
      }
  }
  </code></pre>
  
  <p>I'm refreshing the view with a drop down list via an ajax call on the view that holds the partial:</p>
  
  <pre><code>function reloadNotificationPartial() {
      var notificationID = document.getElementById("SelectedNotification").value;
  
  $.ajax(
  {
      url: '@Url.Action("ReloadNotifications")?notificationID=' + notificationID,
      success: function (html) {
          //Refresh the notification list.
          $('#MainPanel').html(html);
      }
  });
  </code></pre>
  
  <p>}</p>
  
  <p>And here is the controller action:</p>
  
  <pre><code>public PartialViewResult ReloadNotifications(Guid? notificationID)
  {
      if (Request.IsAjaxRequest())
      {
          NotificationPartialViewModel vm = new NotificationPartialViewModel();
  
          _notificationRepository = DependencyResolver.Current.GetService&lt;INotificationRepository&gt;();
          List&lt;Notification&gt; noteList = _notificationRepository.GetAllNotifications();
  
          vm.CurrentNotification = noteList.SingleOrDefault(n =&gt; n.NotificationType.Equals(notificationID));
  
          vm.CurrentNotification.NotificationStart = ConvertToBrowserTime(vm.CurrentNotification.NotificationStart,
                                                                           SecurityCookieManager.getTimeZoneOffset(
                                                                               this.HttpContext));
  
          vm.CurrentNotification.NotificationEnd = ConvertToBrowserTime(vm.CurrentNotification.NotificationEnd,
                                                                         SecurityCookieManager.getTimeZoneOffset(
                                                                             this.HttpContext));
          //Ajax Request, only return the partial view
          return PartialView("NotificationPartial", vm);
      }
      throw new NotImplementedException("Action is not supported in the manner it was called.");
  }
  </code></pre>
  
  <p>So what I'm trying to do is save one of two types of notifications based on a drop down list. When I save back the information CurrentNotification is always null and I haven't been able to figure out what I'm missing to fix this issue, if you need anything else let me know. Thanks in advance for your help!</p>