title: How to update multiple partial views (one main grid and another totals grid)?
body: <p>I have two partial views on my main index page with a filter dropdown.  One partial view is for displaying a list of emps and the other is a roll-up for totaling emp.salary, etc.  Currently, I can update my main emp grid via ajax when the filter dropdown is selected.  The issue is that, my roll-up grid needs to be re-calculated each time a new filter is applied to the main emp grid and I'm not sure how to go about that.</p>
  
  <p>Less details view models here is the code:</p>
  
  <p><strong>Controller: Person/Index()</strong></p>
  
  <pre><code>// GET: /Person/
  public ViewResult Index()
  {
     IList&lt;Person&gt; ppl = cs = db.Persons.ToList();
  
     PersonRollup pr= new PersonRollup();            
     foreach (Person p in ppl)
     {
        pr.salary += ii.salary
     }
     PersonViewModel pvm = new PersonViewModel{Persons = ppl, PersonsRollup = pr}
     return View(pvm);
  }
  </code></pre>
  
  <p><strong>View: Person/Index</strong></p>
  
  <pre><code>@model Models.PersonVM&gt;
  
  @Html.ListBox("Filter")  
  
  &lt;div id="PersonRollupGrid"&gt;@Html.Partial("_PersonsRollup", Model.PersonsRollup)&lt;/div&gt;
  
  &lt;div id="PersonGrid"&gt;@Html.Partial("_Persons", Model.Persons)&lt;/div&gt;  
  
  @* Filter selected from drop down *@
  &lt;script type="text/javascript"&gt;
      $("select").multiselect({
          click: function () {
              $.get('@Url.Action("FilterPersons")', function (data) {
                  $('#PersonGrid').html(data);
              });
              // ???????????????????????????????????????????
              //   How can I update the rollup grid here....
              //???????????????????????????????????????????
              }
          });
  &lt;/script&gt;
  </code></pre>
  
  <p><strong>Shared View: _Persons</strong></p>
  
  <pre><code>@model IEnumerable&lt;Models.Person&gt;
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;Name&lt;/th&gt;
          &lt;th&gt;Salary&lt;/th&gt;
      &lt;/tr&gt;
  
      @foreach (var item in Model) {
      &lt;tr&gt;
          &lt;td&gt;@item.name&lt;/td&gt;
          &lt;td&gt;@item.salary&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>Shared View: _PersonsRollup</strong></p>
  
  <pre><code>@model Models.PersonRollup
  
  &lt;table&gt;
      &lt;tr&gt;
          &lt;th&gt;TotalSalary&lt;/th&gt;
      &lt;/tr&gt;
      &lt;tr&gt;
          &lt;td&gt;@model.salary&lt;/td&gt;
      &lt;/tr&gt;
  &lt;/table&gt;
  </code></pre>
  
  <p><strong>Controller: Filter</strong></p>
  
  <pre><code>  public ActionResult FilterPersons(string someFilteredData)
    {
      IList&lt;Person&gt; ppl = cs = db.Persons.Where(/*someFilteredData*/).ToList();
  
     PersonRollup pr= new PersonRollup();            
     foreach (Person p in ppl)
     {
        pr.salary += ii.salary
     }
     PersonViewModel pvm = new PersonViewModel{Persons = ppl, PersonsRollup = pr}
  
     return PartialView("_Persons", ppl.Persons);
    }
  </code></pre>