title: MVC Ajax update partial view
body: <p>I want to update the partial view every time the ActionLink is clicked. I'm passing the same model to the partial view as the main view. The problem is that partial view is not getting updated. Not sure if I'm on right track.</p>
  
  <p><strong>View</strong> :</p>
  
  <pre><code>@model MyPoll.Models.Poll
  
  @Ajax.ActionLink("For", "AddPositive", new RouteValueDictionary { {"id", Model.Id }},new AjaxOptions() { UpdateTargetId = "countsDiv" })
  
  &lt;div id="countsDiv"&gt;
      @Html.Partial("Counts", Model)
  &lt;/div&gt;
  </code></pre>
  
  <p><strong>Partial</strong>:</p>
  
  <pre><code>@model MyPoll.Models.Poll
  
  Positive count : @Model.PositiveCount
  Negative count : @Model.NegativeCount
  </code></pre>
  
  <p><strong>Controller action</strong> :</p>
  
  <pre><code>public ActionResult AddPositive(int id)
  {
      Poll poll = db.Polls.Find(id);
      poll.PositiveCount++;
      db.SaveChanges();
  
      return View(poll);
  }
  </code></pre>
  
  <p>The scripts are referenced as well:</p>
  
  <pre><code> &lt;script src="/Scripts/jquery.unobtrusive-ajax.min.js" type="text/javascript"&gt;&lt;/script&gt;
   &lt;script src="/Scripts/MicrosoftMvcAjax.js" type="text/javascript"&gt;&lt;/script&gt;
   &lt;script src="/Scripts/MicrosoftAjax.js" type="text/javascript"&gt;&lt;/script&gt;
   &lt;script src="@Url.Content("~/Scripts/jquery-1.5.1.min.js")" type="text/javascript"&gt;&lt;/script&gt;
  </code></pre>