I have parent view that also renders sub-controller action using RenderAction()
(that returns a PartialView
). An example is a front page with Login partial view (inputs: username, password, remember and action: login)
Execution process
- GET for
Home/Index
- also displays my login control that has its login pointing to sub controllerUser/Login
- User enters credentials and clicks login
- POST for
User/Login
- checks credentials and returns ???
Problem
How do I return back to parent view from my sub controller action User/Login
?
My sub controller's partial view can be rendered any page, so I can't just easily return result of parent controller action like:
return new HomeController().Index();
So how should I process my sub controller action and its partial view?
EDIT
I could post back to my sub-controller action with additional data of the parent route, but I also populate data in my sub-controller action. In my example I have to display that someone's credential weren't valid. A redirect would lose these...