Where would you store data, and possibly methods, that is to be used on all views in MVC3? For example, admin email address and site title.
This was accomplished in aspx pages by putting properties and methods on base page that all other pages extended from. Should I do something similar with a base controller class, using the base page class constructor to prepopulate the viewbag? Or should
I use the approach of creating a base view model?
bluesherpa
Member
130 Points
48 Posts
Where to store data common to all views?
Feb 23, 2012 12:26 AM|LINK
Where would you store data, and possibly methods, that is to be used on all views in MVC3? For example, admin email address and site title.
This was accomplished in aspx pages by putting properties and methods on base page that all other pages extended from. Should I do something similar with a base controller class, using the base page class constructor to prepopulate the viewbag? Or should I use the approach of creating a base view model?
Thanks,
Ed