Duplicate
I have been following this method for passing common data to the site.master. However, this does require specific casting of the ViewData and I don’t like using string identifiers everywhere. Is this the best way to do it or is there another way?
http://www.asp.net/learn/MVC/tutorial-13-cs.aspx
Thanks
You could create a base class that all your models inherit from:
Then your master page would inherit from
ViewMasterPage<MasterModel>and yourPage1.aspxwould inherit fromViewPage<Page1Model>and setSite.masteras its master page.