开发者

ASP.NET MVC subsections

There is a master page with a simple menu at the top (MenuItem1, MenuItem2 and Admin开发者_C百科istration) and a content area below. The first two entries are just links to HomeController actions which render views (which use the master page). With Administration there is a need to manage different kinds of objects (for example: users, groups, items, etc.) and it does not fit into one action idea. I know that it may be solved by adding the top menu "User Administration", "Group Administration", etc. (instead of a single menu item Administration) but I don't like the solution. I prefer to have have some subsections under Administration - a kind of submenu or tabs which are only visible when Administration has been selected. How to achieve it in ASP.NET MVC?

Thanks in advance

Lukasz


You may find the usage of Html.Action and Html.RenderAction helpers useful. They allow you to have completely separate child MVC life-cycle integrated into the main MVC pipeline.


I would suggest using Areas. An area will give your the administration section from which you can create the different sub-sections. It also has its own routing table to modify.

Quick little MS video on Areas.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜