View not refreshing following post in Razor MVC using datatable <p>As per subject. The view looks like this.</p> <pre><code>@using System.Globalization @model IEnumerable&lt;TaskEngine.WebUI.Models.TaskViewModel&gt; &lt;script src="../../Scripts/progress-task.js" type="text/javascript"&gt;&lt;/script&gt; &lt;script type="text/javascript"&gt; $(document).ready(function () { $.ajax({ url: '@Url.Action("Index", "Home")', data: { from: "10/01/2014", to: "10/14/2014" }, dataType: "html", success: function () { alert('Success'); }, error: function (request) { alert(request.responseText); } }); }); &lt;/script&gt; &lt;div class="container"&gt; &lt;div class="row"&gt; &lt;div class="span16"&gt; &lt;div id="sitename"&gt; &lt;a href="/" id="logo"&gt;xxxxxxxx&lt;/a&gt; &lt;span class="name"&gt;Workbasket&lt;/span&gt; &lt;/div&gt; &lt;div class="row"&gt; &lt;div class="span16"&gt; &lt;table class="table table-striped table-condensed" id="task-table"&gt; &lt;thead&gt; &lt;tr&gt; &lt;th class="left"&gt;Client&lt;/th&gt; &lt;th class="left"&gt;Task&lt;/th&gt; &lt;th class="left"&gt;State&lt;/th&gt; &lt;th class="left"&gt;Assigned By&lt;/th&gt; &lt;th class="left"&gt;Assigned To&lt;/th&gt; &lt;th class="left"&gt;Date Opened&lt;/th&gt; &lt;th class="left"&gt;Date Due&lt;/th&gt; @* &lt;th class="left"&gt;Date Closed&lt;/th&gt;*@ &lt;th class="left"&gt;Outcomes&lt;/th&gt; &lt;/tr&gt; &lt;/thead&gt; &lt;tbody&gt; @foreach (var task in Model) { &lt;tr&gt; &lt;td&gt;&lt;span&gt;@task.ClientId&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="nowrap"&gt;@task.TaskDescription&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span class="nowrap"&gt;@task.CurrentState&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span &gt;@task.AssignedBy.Replace("CORPORATE\\", "").Replace(@".", " ")&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span&gt;@task.AssignedTo.Replace("CORPORATE\\", "").Replace(@".", " ")&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span&gt;@task.DateOpened.ToString("dd/MM/yyyy HH:mm")&lt;/span&gt;&lt;/td&gt; &lt;td&gt;&lt;span&gt;@task.DateDue.ToString("dd/MM/yyyy HH:mm")&lt;/span&gt;&lt;/td&gt; @* &lt;td&gt;&lt;span&gt;@(task.DateClosed.HasValue ? task.DateClosed.Value.ToShortDateString() : " - ")&lt;/span&gt;&lt;/td&gt;*@ &lt;td&gt; &lt;span class="nowrap"&gt; @Html.DropDownList( "Outcomes", new SelectList(task.Outcomes, "Id", "Name"), "---Please Select ---", new Dictionary&lt;string, object&gt; { {"data-case-id", @task.CaseId }, {"data-task-log-id", @task.TaskLogId}, {"data-client-id", @task.ClientId} }) &lt;/span&gt; &lt;/td&gt; &lt;/tr&gt; } &lt;/tbody&gt; &lt;/table&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;div class="modal hide span8" id="complete-task-modal" tabindex="-1" role="dialog" aria-labelledby="complete-task-header" aria-hidden="true"&gt; &lt;div class="modal-header"&gt; &lt;button type="button" class="close" data-dismiss="modal" aria-hidden="true"&gt;×&lt;/button&gt; &lt;h3 id="complete-task-header"&gt;Complete Task&lt;/h3&gt; &lt;/div&gt; &lt;div class="modal-body"&gt; &lt;div class="row"&gt; &lt;div class="span8"&gt; &lt;div class="alert alert-info"&gt; &lt;label id="CurrentState"&gt;&lt;/label&gt; &lt;label id="NewState"&gt;&lt;/label&gt; &lt;label&gt;Generated Tasks&lt;/label&gt; &lt;ul id="task-list"&gt; &lt;/ul&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; &lt;form id="form"&gt; &lt;input type="hidden" id="task-log-id" name="taskLogId" /&gt; &lt;input type="hidden" id="case-id" name="caseId" /&gt; &lt;input type="hidden" id="outcome-id" name="triggerId" /&gt; &lt;input type="hidden" id="client-id" name="clientId" /&gt; &lt;div id="popup"&gt; &lt;/div&gt; &lt;/form&gt; &lt;/div&gt; &lt;div class="modal-footer"&gt; &lt;button class="btn" id="close" data-dismiss="modal" aria-hidden="true"&gt;Go Back&lt;/button&gt; &lt;button class="btn btn-primary" id="confirm-task"&gt;Confirm&lt;/button&gt; &lt;/div&gt; &lt;/div&gt; &lt;/div&gt; </code></pre> <p>This is the controller method.</p> <pre><code> public ActionResult Index(DateTime? from, DateTime? to) { var usergroups = GetGroups(HttpContext.User.Identity.Name); var model = _taskLogger.GetTasks(from, to) .Select(task =&gt; new TaskViewModel { TaskLogId = task.TaskLogId, CaseId = task.CaseId, ClientId = task.ClientId, TaskDescription = task.Description, AssignedBy = task.AssignedBy, AssignedTo = task.AssignedTo.Trim(), DateOpened = task.DateCreated, DateClosed = task.DateClosed, DateDue = task.DateDue }).ToList() .Where(x =&gt; IsAvailableToUser(x.AssignedTo, usergroups)) .OrderBy(x =&gt; x.DateDue); foreach (var task in model) { var workflow = _workflowEngine.GetCase(task.CaseId); task.CurrentState = workflow.State.ToNonPascalString(); task.Outcomes = workflow.GetPermittedTriggers().OrderBy(x =&gt; x.Name).ToList(); } ModelState.Clear(); return View(model); } </code></pre> <p>When the model is returned following the ajax post, the dataset is different, as expected, however, within the datatable in the view it still displays the old data.</p> <p>Having done some googling on this issue, I've tried clearing the modelstate but that makes no difference and from what I've read, it only seems to affect HTMLHelpers anyway.</p> <p>I'm not sure if this is an issue with the datatable or just a refresh issue with the view itself. Any input would be appreciated.</p>