title: ASP.NET MVC Knockout Binding Not Working
body: <p>I am working with Mvc4/bootstrap 3.2 and knockout 3.2. Problem Is I have a form that has a. textbox and button, on button click I pass textbox value to controller. After receiving data from controller binding viewModel with table. But neither data is not updated in table nor the mvc Model updated. I have check that while submitting the data.</p>
  
  <p>ViewModel : I have Tried ViewMoel in two ways</p>
  
  <pre><code>var SibviewModel=null;
      $(function () {
          var model = @Html.Raw(Json.Encode(Model));
          SibviewModel = ko.mapping.fromJS(model);
          ko.applyBindings(SibviewModel);
      });
  
  function GetMatchingSibling(_Id) {
          var url = "/Home/GetStudentSiblingDetails/?Id=" + _Id;
          $("#myModal").modal('show');
          $.ajax({
              url: url,
              cache: false,
              type: "GET",
              success: function (data) {
                  try {
                      $(data.data).each(function (index, element) {
                          SibviewModel.SibviewModel.push(element);
                      });
                      ko.applyBindings(viewModel);
  
                  } catch (e) {
                      $(".alert-dismissable")
                      .alert('show')
                      .addClass("alert-danger")
                      .append("&lt;h3&gt;"+e+"&lt;/h3&gt;");
  
                  }
                  finally {
                      $("#myModal").modal('hide');
                  }
  
  
              },
              error: function (reponse) {
                  alert("error : " + data.error);
                  $("#myModal").modal('hide');
              }
          });
      }
  </code></pre>
  
  <p>Then I wrote MVC Razor view</p>
  
  <pre><code>&lt;tbody data-bind="foreach: lookupCollection"&gt;
              @foreach (var item in Model.LinkedSiblings)
              {
                  string dobval = "";
                  if (Model.DOB.HasValue)
                  {
                      dobval = Model.DOB.Value.ToString("dd-MM-yyyy");
                  }
  
                  @Html.HiddenFor(x =&gt; item.PhoneNo, new { @Name = "LinkedSiblings[" + item.DynamicControlId + "].PhoneNo", @Value = item.PhoneNo, data_bind = "value: PhoneNo" })
                  @Html.HiddenFor(x =&gt; item.Email, new { @Name = "LinkedSiblings[" + item.DynamicControlId + "].Email", @Value = "santokh.hcl@hmail.com", data_bind = "value: Email" })
                  @Html.HiddenFor(x =&gt; dobval, new { @Name = "LinkedSiblings[" + item.DynamicControlId + "].DOB", @Value = dobval, data_bind = "value: DOB" })
                  @Html.HiddenFor(x =&gt; item.LastName, new { @Name = "LinkedSiblings[" + item.DynamicControlId + "].LastName", @Value = item.LastName, data_bind = "value: LastName" })
                  &lt;tr&gt;
                      &lt;td data-bind="text: StudentId"&gt;@Html.TextBoxFor(x =&gt; item.StudentId, new { style = "max-width:100px;", @Name = "LinkedSiblings[" + item.DynamicControlId + "].StudentId", @Value = item.StudentId, data_bind = "value: StudentId" })
                      &lt;/td&gt;
                      &lt;td&gt;@Html.TextBoxFor(x =&gt; item.AdmissionId, new { style = "max-width:100px;", @Name = "LinkedSiblings[" + item.DynamicControlId + "].AdmissionId", @Value = item.AdmissionId, data_bind = "value: AdmissionId" })
                      &lt;/td&gt;
                      &lt;td&gt;@Html.TextBoxFor(x =&gt; item.FirstName, new { style = "max-width:100px;", @Name = "LinkedSiblings[" + item.DynamicControlId + "].FirstName", @Value = item.FirstName, data_bind = "value: FirstName" })
                      &lt;/td&gt;
                      &lt;td&gt;@Html.TextBoxFor(x =&gt; item.ClassId, new { style = "max-width:100px;", @Name = "LinkedSiblings[" + item.DynamicControlId + "].ClassId", @Value = item.ClassId, data_bind = "value: ClassId" })
                      &lt;/td&gt;
                  &lt;/tr&gt;
  
              }
              @Html.EditorFor(x =&gt; Model.LinkedSiblings)
          &lt;/tbody&gt;
      &lt;/table&gt;
  </code></pre>
  
  <p>Neither the View is updated with the Values not the Values Received on Controller Method when submit the form.</p>