Reputation: 553
I was wondering if theres a way of using controllers for my master pages.
Cheers
Upvotes: 0
Views: 634
Reputation: 3447
Not really. But you can create a Controller for a document type. Which is probably what you want to do.
If you inherit a controller from Umbraco.Web.Mvc.RenderMvcController and name it appropriately, this controller will be picked up automatically by Umbraco. In the index method you can control the Model which is passed to the view.
The naming of the controller has to be DocTypeAliasController.
It's described in the documentation as "Custom controllers": http://our.umbraco.org/Documentation/Reference/Templating/Mvc/custom-controllers
If you are using forms and posting back information, you should look at the SurfaceControllers: http://our.umbraco.org/documentation/reference/templating/mvc/surface-controllers
Upvotes: 3