Pass data to Master Page with ASP.NET MVC

Posted by Brian David Berman on Stack Overflow See other posts from Stack Overflow or by Brian David Berman
Published on 2010-04-07T15:04:34Z Indexed on 2010/04/07 16:33 UTC
Read the original article Hit count: 676

I have a hybrid ASP.NET WebForms/MVC project. In my Master Page, I have a "menu" User Control and a "footer" User Control. Anyways. I need to pass some data (2 strings) to my "menu" User Control on my Master Page (to select the current tab in my menu navigation, etc.) My views are strongly-typed to my data model. How can I push data from my controller to my menu or at least allow my master page to access some data pre-defined in my controller?

Note: I understand this violates pure ASP.NET MVC, but like I said, it is a hybrid project. The main purpose of my introduction to ASP.NET MVC into my project was to have more control over my UI for certain situations only.

© Stack Overflow or respective owner

Related posts about asp.net-mvc

Related posts about master-pages