I have a page "ViewUser". with this structure
//display something about the user
@{Html.RenderAction("UpdateUser", new { UserId = @Model.UserId });}
//display some more stuff
In the controller method for UpdateUser I have
public ActionResult UpdateUser(int UserId){//populate form vars
[HttpPost]
public ActionResult UpdateUser(User u)//
// code to update the user
return RedirectToAction("ViewUser", new { User = u.UserId });
When I open the page it works fine I see my user data and the date in the UpdateUser form. However when I update the user data and redirect to the ViewUser page from UpdateUser I get "Child actions are not allowed to perform redirect actions."
but opening the page manually again show that the update was successful. As far as I understand the browser should be performing a new GET for everything so I don't understand why it works for a manual refresh but not when UpdateUser returns the redirect?