Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6806293
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T19:41:34+00:00 2026-05-26T19:41:34+00:00

I have a MVC3 application, based on default layout from VS 2010, which I

  • 0

I have a MVC3 application, based on default layout from VS 2010, which I changed to looklike in image below

Layout1

The submenu area is defined in _layout.cshtml as

    <div id="sidebar">
    <h3>Entities</h3>
    <p></p>
        <ul>
            @Html.Partial("_EntitiesMenu")
        </ul>        
    </div>
    <section id="main">
        @RenderBody()
    </section>

and the _EntitiesMenu contains entries as below

<li>@Html.ActionLink("Addresses", "Index", "Address")</li>      
<li>@Html.ActionLink("Applications", "Index", "Application")</li>       

I have a single MapRoute defined as

routes.MapRoute("Default", // Route name
    "{controller}/{action}/{id}", // URL with parameters
     { controller = "Home", action = "Index", id = UrlParameter.Optional });

All my entity controllers started from menu are defined standard in Controllers and views in Views.

What I need is to change the app to use a layout as below

Layout2

When users click Entities app should navigate to myapp/entities/ or myapp/entities/index and it should open a view in main work area that will look like below

Layout3

Then when users click on right submenus, the url should look like myapp/entities/entity1/index, myapp/entities/entity1/edit/1, etc (exactly like now but "under" entities page.
I defined the Entities controller like

public class EntitiesController : Controller
{
    public ActionResult Index()
    { return View();}
}

And it’s view looks like

<div id="workarea">
    // here should became new Body region, to load all views called from the other controllers
    // something like @RenderBody(), but this don't works
</div>
<div id="sidebar">
<h3>Entities</h3>
<ul>
    @Html.Partial("_EntitiesMenu")
</ul>        
</div>

I don’t want to have to make changes to entities controllers or views (or minimal changes if absolutely necessary, because there are lot of them). Can I somehow assign that area as main Body, while under scope of entities? And if user click on top Home / About, it will "unload" the EntitiesView from _layout.cshtml?

Not sure if my question is very clear, but I hope someone will understand what I’m after.

Thank you

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T19:41:35+00:00Added an answer on May 26, 2026 at 7:41 pm

    I managed (sort of) to accomplish something close to what I need using following approach:

    1. Changed the _layout as below

      <section id="main">
          <div>
              @RenderBody()
          </div>
          <div>
              @RenderSection("EntityCRUD", false)
          </div>
      </section>
      
    2. Created the view for Entities as:

      @Html.Partial(“_PanelEntitiesMenu”)

    3. Defined _PanelEntitiesMenu as

      <div id="sidebar">
      <h3>Entities</h3>
      <p></p>
          <ul>
          @Html.Partial("_EntitiesMenu")
          </ul>        
      </div> 
      
    4. Enclosing the entities views (Index, Edit / Delete / Details / Create) in

      @section EntityCRUD
      {
      @Html.Partial("_PanelEntitiesMenu")
      //... original view code
      }
      
    5. Changed all involved views to have the view “body” included in section, and at the beginning of the section I load the panel menu as partial view

      @section EntityCRUD
      {
          @Html.Partial("_PanelEntitiesMenu")
          ....
      }
      

    Not exactly what I wanted, but that’s the best I found so far.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an MVC3 and EF 4 Code First application, which is configured to
I have created a simple application using MVC3 and the site is based on
I have a View in my MVC3 application which displays one of two pretty
I have MVC3 & SqlServer 2008 based application recently deployed. The application works fine
I have a fairly large MVC3 application, of which I have developed a small
I have an MVC3 project for which I use NinjectMVC3 for dependency injection -
I have an application based on 3 tier architecture with postgres database(npgsql) having more
I am building an MVC-based e-commerce application with MVC3 based on nopCommerce. I am
I have a new MVC3 application with a few legacy Web Form pages. I'm
I am developing one new area of a fairly large web application using MVC3

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.