title: MVC Performance Issue with many fields
body: <p>I have a form that dynamics generates a lot of checkboxes (700+).  The form loads very slowly in IE (but barely loads in chrome), and when I post the form it pretty much locks up my web browser.</p>
  
  <p>How can i debug this or am I doing something wrong that’s causing this performance issue? Or is this expected with a huge form and I should try to split it up.  </p>
  
  <p>Here is my controller:</p>
  
  <pre><code>public ActionResult Create(int id)
      { 
              var model = new TaskRequestViewModel
                  {
                      Task = new Task(),
                      Components = db.Component.ToList()
                         …. 
                   }
              return View(model);           
      }
  </code></pre>
  
  <p>To briefly explain my model, I have about 10 components, each component has about 10 sub-components, and each sub- component has about 10 options (checkboxes) available.  Resulting in said 700+ fields (and then a few hidden fields).  It worked OK when there were fewer checkboxes (100ish).</p>
  
  <p>My view is something like this (with 3 nested loops):</p>
  
  <pre><code>           @for (int cI = 0; cI &lt; Model.Components.Count; cI++)
             {  
                      @Html.HiddenFor(x =&gt; Model.Components[cI].ComponentId)  
  
                      @for (int scI = 0; scI &lt; Model.Components[cI].SubComponents.Count; scI++)
                      { 
                              @Html.DisplayFor(x =&gt; Model.Components[cI].SubComponents[scI].Name)                                 
                              @Html.HiddenFor(x =&gt; Model.Components[cI].SubComponents[scI].SubComponentId)
  
                              @for (int t = 0; t &lt; Model.Components[cI].SubComponents[scI].TaskTypes.Count; t++)
                              {
                                  @Html.HiddenFor(x =&gt; Model.Components[cI].SubComponents[scI].TaskTypes[t].SubComponentTaskTypeId)
                                  @Html.HiddenFor(x =&gt; Model.Components[cI].SubComponents[scI].TaskTypes[t].TaskTypeId)
                                  @Html.CheckBoxFor(x =&gt; Model.Components[cI].SubComponents[scI].TaskTypes[t].Active)
                             } 
  
                      }
  
            }
  </code></pre>