@druttka. , .
, 2 :
, , , . . , , . , OnActionExecuted
nav, .
An alternative is to add nav to ViewBag
. This can be done every time and does not force you to specify a model for each view, which is great for flexibility in cases where you do not need to specify a model. It should be noted, however, that ViewBag
in asp.net mvc 3 is of type dynamic, which cannot be used as a parameter in a lambda function, thereby preventing you from doing something like @Html.DisplayFor(viewBag => viewBag.MainNav)
in your layout, which is real resistance. You can still partialize and specify the appropriate DisplayTemplate.
source
share