Question

I was wondering if theres a way of using controllers for my master pages.

Cheers

Was it helpful?

Solution

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

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top