I have a partial view named '_MenuPartial' which has dynamic data from the database.Now I render this view in the '_Layout.cshtml' as below
_Layout.cshtml:
@Html.Partial("_MenuPartial");
in my controller, I will send the menu data model to the 'index.view' which is based on the '_Layout.cshtml'.
But My question is that when I want to set the Layout for other views, I need send the menu data model in other views' controller which I think is redundant. So What's the standard way to sent the data model to partial view in the Layout page? How to response a view which has the layout but don't give the data model layout page need?
Hope your answer. thanks a lot!