Answer the question
In order to leave comments, you need to log in
How to display the menu layout and the main workspace on the main page in an ASP.NET MVC project?
There is a main standard Layout in which I display parts of the top menu _NavigationLayout, the side menu _PanelNewsLayout, the workspace using @RenderBody ().
<!DOCTYPE html>
<html>
...
<body>
@Html.Partial("_NavigationLayout")
<div class="main">
@Html.Partial("_PanelNewsLayout")
<div class="content">
<div class="container">
@RenderBody()
</div>
</div>
</div>
...
</body>
</html>
Answer the question
In order to leave comments, you need to log in
Don't mix markup with logic. Alternatively, you can load the menu through jQuery - call a separate controller method.
You can pass it through ViewBag - take a closer look at how your ViewBag.Title is passed from pages to _Layout - in the standard ASP.NET MVC template
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question