Refresh Index after redirecting to it from AJAX call <p>I have a situation where I am setting a user value and trying to reload the index page. This is only a sample page and I cannot user any kind of user controls, like ASP.NET. Each user is in the database and the role is retrieved from there. My index is this:</p> <pre><code> [HttpGet] public ActionResult Index(long? id) { AdminModel admin = new AdminModel(); UserModel usermodel = new UserModel(); if (id != null) { admin.UserModel = usermodel; admin.UserModel.UserId = id.ToString(); admin.UserModel = UserAndRoleRepository.GetOrStoreUserProfile(admin.UserModel.UserId); } else { admin.UserModel = usermodel; admin.UserModel = UserAndRoleRepository.GetOrStoreUserProfile(currentUser); } return View(admin); } </code></pre> <p>This works fine when first loaded. In the page I am setting values based upon the user role:</p> <pre><code> $(document).ready(function () { debugger; user = function () { return @Html.Raw(Json.Encode(Model)) }(); if (user.UserModel != null) { if (user.UserModel.UserRole == 'ADMIN') { $("#btnAdmin").show(); $("#btnTran").show(); $("#btnNew").show(); $("#btnAdjust").show(); $("#btnReports").show(); } if (user.UserModel.UserRole == 'TRANS') { $("#btnReports").show(); $("#btnTran").show(); } if (user.UserModel.UserRole == 'REPORTS') { $("#btnReports").show(); } } }); </code></pre> <p>The AJAX call is this:</p> <pre><code> $.ajax({ type: 'POST', dataType: 'json', url: '@Url.Action("SetUser")', data: { userid: ui.item.value }, success: function (data) { if (data == null) { } else { } }, error: function (xhr) { //var err = xhr.responseText; //alert('error'); } }); </code></pre> <p>And the SetUser action:</p> <pre><code> [HttpPost] public ActionResult SetUser(string userid) { return RedirectToAction("Index", new { id = Convert.ToInt64(userid) }); } </code></pre> <p>This works fine in that the Index method is fired with the chosen ID, but the page does not reload to be able to set the buttons. Any ideas?</p>