Having googling for some time, I\'m a little bit confused with how to do this in asp mvc 3.
So, the task is to have a common layout (or master?) page for several control
It's an interesting debate topic -> passing view models
to the master page / layout vs ViewBags
.
I'm -hate- using ViewBags
so I have view models for all my view-layers. Starting with the _layout.cshtml
and upwards. Any view that uses a Layout .. well .. that view model just inherits the Layout .. or whatever view is below it .. and this is repeated until you hit the bottom level which is usually the _layout...
My RavenOverflow project has some sample code that shows this.