How can I access a controller instance from the view? E.g. I have a HomeController which then returns my Index view. Inside of that view I want to
ViewContext.Controller, and you'll need to cast it.
<% var homeController = ViewContext.Controller as HomeController; %>
This is covered with a few extra wrinkles in post Asp.Net MVC: How do I get virtual url for the current controller/view?.
EDIT: This is to add some meat to Mark Seemann's recommendation that you keep functionality out of the view as much as humanly possible. If you are using the controller to help determine the markup of the rendered page, you may want to use the Html.RenderAction(actionName, controllerName) method instead. This call will fire the action as though it was a separate request and include its view as part of the main page.
This approach will help to enforce separation-of-concerns because the action method redirected to can do all the heavy lifting with respect to presentation rules. It will need to return a Partial View to work correctly within your parent view.