title: Update current View MVC 5 after save
body: <p>I have the following code and want to update the user role with dropdown then stay on this page with the updated choice from the dropdown. I thought I could use redirectToAction to the GET ActonResult but it goes to the POST ActionResult. How do I stay on the same view with the dropdown updated with new choice? Thanks</p>
  
  <pre><code>    [HttpGet]
      public ActionResult Details(Guid? id)
      {
          if (id == null)
          {
              return new HttpStatusCodeResult(HttpStatusCode.BadRequest);
          }
  
          Employee employee = db.Employees.Find(id);
  
          EmployeeViewModel empv = new EmployeeViewModel();
          empv.FirstName = employee.FirstName;
          empv.LastName = employee.LastName;
          empv.NetworkLoginID = employee.NetworkLoginID;
          empv.PersonID = employee.PersonID;
          empv.DataStatusID = employee.DataStatusID;
          empv.EmployeeGUID = employee.EmployeeGUID;
  
  
  
  
          Guid UserRoleGuid = (from e in db.EmployeeToUserRoles
                             where e.EmployeeGUID == empv.EmployeeGUID
                               select e.RoleGUID).FirstOrDefault();
  
  
  
          empv.RoleID = UserRoleGuid;
  
          if (employee == null)
          {
              return HttpNotFound();
          } 
          PopulatedDropDown(empv.RoleID);
  
          return View(empv);
      }
      [HttpPost]
      public ActionResult Details(Guid EmployeeGUID, Guid Roles)
      {
          if (ModelState.IsValid)
          {
  
              EmployeeToUserRole emp = new EmployeeToUserRole();
              //check if employee was in role and update column
  
              var inrole = from d in db.EmployeeToUserRoles
                           where d.EmployeeGUID == EmployeeGUID                       
                           select d.EmployeeRoleGUID;
  
              int count = inrole.Count();
  
              if (count &gt; 0  )
              {
                  emp = db.EmployeeToUserRoles.Where(s =&gt; s.EmployeeGUID == EmployeeGUID).FirstOrDefault&lt;EmployeeToUserRole&gt;();
  
                  emp.RoleGUID = Roles;
                  db.Entry(emp).State = EntityState.Modified;
  
  
                  db.SaveChanges();
              }
  
              else
              { 
  
              emp.EmployeeRoleGUID = Guid.NewGuid();
              emp.RoleGUID = Roles;
              emp.EmployeeGUID = EmployeeGUID;
  
              db.EmployeeToUserRoles.Add(emp);
              db.SaveChanges();
              }
  
  
              PopulatedDropDown(Roles);
  
              RedirectToAction("Details", new { id = emp.EmployeeGUID });
  
          }
  
          return View();
  
  
      }
  </code></pre>