ASP.Net MVC Controller for _Layout

前端 未结 1 802
离开以前
离开以前 2020-12-17 18:53

I am working on a dynamic menu system for MVC and just to make it work, I created a partial view for the menu and it works great using the syntax below:

@Htm         


        
1条回答
  •  猫巷女王i
    2020-12-17 19:15

    set your menu up as an action then call it in your master layout.

    use @Html.Action()

    the action can return a partial view with your menu code in it.

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