I am using asp.net mvc 3.0 with razor.
I am wondering if I can make a view model for my master page. I have some dynamic data in my master page so I am going to probably have to make a “base class” for all my controllers but I rather have strongly typed data then View Data/ View Bag.
So can this be done?
You could have all of your view models inherit from a base view model, which would include all of your common fields.
Alternatively, you could use a Custom Action Filter that would put some object in the view data which your master page would always expect to be there. This action filter could also be used to fill in the common fields in your view model base class.