I think this is a pretty common scenario, but I haven't been able to phrase my problem in such a way that I have generated any useful search engine results. I'd like the Index action of my HomeController to return the action from a different controller.
I have come up with a few solutions but have dismissed each for various reasons:
- Using a
RedirectToActiondoesn't seem like the right solution asRedirecToActionresults in an HTTP 303 which for a site's homepage seems wrong. - Instantiating the other controller and calling its action from within the
HomeControllerIndexaction; this option just smells bad. - Placing the same dependencies as the other controller on the
HomeControllerand utilizing the same repository methods. While this is the easiest of the options I've come up with it seems like a cop out.
So, what am I missing here? Does the ASP.NET MVC framework provide a "right" way to do this?