Microsoft.NET I’m just getting started with my first ASP.NET MVC application and I’m already running into some roadblocks trying to grok it. 

I have used WebForms using VB.NET for about 6 years now and master pages were the best invention next to generics (at least for my apps).   I implemented them in my applications immediately and haven’t looked back.  In 3.5, I was glad to learn that nested master pages were now supported in the IDE.

Anyway, off topic; I am going to use one of my websites as a guinea pig to port over to ASP.NET MVC.  Naturally, I looked at the design and layout of the site.  Where did I turn?  The master page naturally.  However, because of the way that MVC is implemented, how can I pass data from a Controller to the master page?

So, for example: I have a dynamically created menu that I want to cache based on the available roles of the user.  In MVP, I would just pass the List<of MenuItemDTO> to the View.  How would this be done in MVC?

I searched a little to find a post by Stephen Walther on Passing Data to Master Pages and User Controls.  I didn’t find anything that was definitive on the best practice, even though he did recommend using an abstract controller base class.

Still, that leaves me wondering how this can be accomplished properly with ASP.NET MVC.  I would like to dive further into MVC before I judge it’s feasibility for my project.  I know I would be able to make it work in MVC, but I would like the pattern to be used properly so testing becomes part of my design process (which in MVP, it’s more building the interface before testing).

I’m doing it wrong.