title: Why updateModel() dont update my model! in MVC ASP.NET for the nested IList<Object>?
body: <h2>Models :</h2>
  
  <pre><code>public class Category
    {
      [Key]
      public int Categoryid { get; set; }
  
      [Required , StringLength(50)]
      public string Categoryname { get; set; }
      public virtual IList&lt;SubCategory&gt; SubCategories { get; set; }
    }
  
    public class SubCategory
    {
  
      [Key]
      public int SubCategoryid { get; set; }
      [Required, StringLength(50)]
      public string SubCategoryname { get; set; }
      public int Categoryid { get; set; }
  
      public SubCategory( string name)
      {
          SubCategoryname = name;
      }
  
      public SubCategory()
      {          
      }
    }
  </code></pre>
  
  <hr>
  
  <h2>Controller</h2>
  
  <pre><code>[HttpPost]
  public ActionResult Edit(Category CatModifications, int id, string txtSub, string SubCreate, string SaveAll)
  {
    Category Cat = context.Categories.Single(model =&gt; model.Categoryid == id);
    UpdateModel(Cat, new string[] { "Categoryname" });
  
      if (ModelState.IsValid)
      {
        // Create Sub
        if (SubCreate != null)
        {
          if (txtSub != "")
          {
            context.SubCategories.Add(new SubCategory(txtSub) { Categoryid = Cat.Categoryid });
            context.SaveChanges();
          }
          return RedirectToAction("Edit");
        }
        if (SaveAll != null)
        {               
          // Edit Sub/Cat
          for (int i = 0; i &lt; Cat.SubCategories.Count; i++)
          {
            UpdateModel(Cat, new string[] { "SubCategories["+i+"].SubCategoryname" });&lt;---------- Here my Model dont update with my subcat
          }
          context.Entry(Cat).State = EntityState.Modified;
          context.SaveChanges();
          return RedirectToAction("index");
        }
  
      }
      return View();
     }
  </code></pre>
  
  <hr>
  
  <h2>view</h2>
  
  <pre><code>@using (Html.BeginForm()) {
  @Html.ValidationSummary(true)
  
    &lt;div&gt;
      @Html.LabelFor(model =&gt; model.Categoryname)&lt;br/&gt;
      @Html.EditorFor(model =&gt; model.Categoryname)
    &lt;/div&gt;
  
  
    &lt;div&gt;
      @if (Model != null &amp;&amp; Model.SubCategories != null)
      {
        @Html.LabelFor(model =&gt; model.SubCategories)&lt;br/&gt;
  
        for (int i = 0; i &lt; Model.SubCategories.Count; i++)
         {
           &lt;input type="text" name="SubCategories[@i].SubCategoryname" value="@Model.SubCategories[@i].SubCategoryname"/&gt;
           //@Html.EditorFor(model =&gt; model.SubCategories[i].SubCategoryname)
           @Html.ActionLink("Delete", "DeleteSub", "Categories", new {SubId = Model.SubCategories[i].SubCategoryid}, null)&lt;br/&gt;
         }
  
      &lt;input type="text" value="" name="txtSub"/&gt;
      &lt;input type="submit" value="Create SubCategory" name="SubCreate"/&gt;
      }
    &lt;/div&gt;
  
    &lt;div&gt;
    &lt;input type="submit" value="Save" name="SaveAll" /&gt;
    &lt;/div&gt;
  }
  
  &lt;div class="Back-Button"&gt;
      @Html.ActionLink("Back to List", "Index")
  &lt;/div&gt;
  </code></pre>
  
  <p>-</p>
  
  <p>so! my not nested list proprieties (categoryname) updating well but not my nested list one (subcategories[i]subcategoryname) ... any one know why or if i did somting wrong here ? ty a lot ...</p>