asp.net mvc - View Models (ViewData), UserControls/Partials and Global variables - best practice? -
I'm trying to understand a good way of 'global' members (like current users, themes, etc.) All of my partial As well as in my thoughts. I do not have to be a logic that can return this data (like BL.CurrentUser) I think it should be a part of the model in my thoughts so I inherited these members from BaseViewData tried. In my controllers, in this way or some other (in a filter or base method in my BaseController), I make an example of an inheriting class and pass it as a visual data. Everything is perfect right up to this point, so my view data is available on the main view with base views. But what about partial? If I have a simple partial that needs to be displayed in a blog post, then it looks like this: @ control language = "C # "AutoAventWireUp =" True "Inheritance =" Viewer Control "& Gt%; And in my opinion, this is a simple code for partially presenting (this is its model. Posts IEnumerable ): & lt;% exotic (...