0

There is a master page with a simple menu at the top (MenuItem1, MenuItem2 and Administration) 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

2 Answers 2

1

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.

Sign up to request clarification or add additional context in comments.

2 Comments

Is there any best practice how to send information which section is the "selected" one?
@GUZ, you could pass parameters to those helpers.
0

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.

1 Comment

After watching the video I have a feeling that areas are just to separate different parts of a website. I still don't know how to compose a view using the master page with administration subsection links and the chosen subsection.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.