The controller for path … was not found or does not implement IController

前端 未结 1 1939
执笔经年
执笔经年 2021-01-15 06:18

I am writing an application using ASP.NET MVC 5 using c#. I have a need to add a global menu on the upper right hand side of the application. I was advised other SO to use a

相关标签:
1条回答
  • 2021-01-15 06:54

    Take ClientMenus Action out of the BaseController and put it into its own controller MenusController. You can then call that controller from your Views.

    @Html.Action("ClientsMenu", "Menus")
    

    In your example you don't have a MenusContoller which is what @Html.Action("ClientsMenu", "Menus") is looking for.

    The Phil Haacked - Html.RenderAction and Html.Action article linked to by the other post provided a good example for you to follow.

    0 讨论(0)
提交回复
热议问题