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

  • SEARCH
  • Home
  • 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 7176163
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T16:27:13+00:00 2026-05-28T16:27:13+00:00

I’m having trouble getting nested areas to work. I would like to use a

  • 0

I’m having trouble getting nested areas to work.

I would like to use a structure within the Areas folder, to organize my areas. I.e.:

  • Areas
    • Admin
      • Index (Default)
      • Locations
        • Controllers
        • Models
        • Views
      • …
    • Applications
      • Index (Default)
      • Calendar
        • Controllers
        • Models
        • Views
      • …
    • …

How do I go about structuring that with routes and how do I register each area. “Admin” and “Applications” are what I would call sections, and then the actual areas are located within a section.

I would have preferred using a route with an extra element, section, like so:

routes.MapRoute(
    "Applications_default",
    "{section}/{area}/{controller}/{action}/{id}",
    new { section = "Applications", area = "Index", action = "Index", controller = "Home", id = UrlParameter.Optional }
);

Would that be possible?

I think I’m missing something with routes, because adding the route is one thing, but what would I name the area (AreaName property)? “Admin/Index”? “Admin.Index”? “Index” could be used in other places..

For now I’m trying the “normal” area registration using:

public override void RegisterArea(AreaRegistrationContext context) {
context.MapRoute(
    "Admin_Index_default",
    "Admin/Index/{controller}/{action}/{id}",
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

}

But when I go to http://localhost:60864/Admin/Index/Home/Index I get an error saying: “The resource cannot be found.” 🙁

How do I structure my routes to comply with my desired tree structure?
I looked at another question: Can I nest areas in ASP.NET MVC?, but it did not solve my problem 🙁

Any help and guidance would be appreciated!

Thanks in advance

  • 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-28T16:27:13+00:00Added an answer on May 28, 2026 at 4:27 pm

    You should not restructure or reorganize your Areas folder. Keep the default, where each area has a Controllers, Models, and Views folder (plus AreaRegistration.cs, etc). Otherwise, you may be dealing with a spiderweb of namespace problems. Also, you will have to tell the razor engine which folders to check to find your views. Trust me your life will be happier if you just follow the conventions when it comes to areas.

    If you want to create a deep URL structure, do it with routes. Your routes can be completely independent of your folder structure in MVC (unlike in webforms).

    Do you try this route with a fresh MVC project? Meaning, no re-arrangement of the Areas folders? It should work, as long as your Admin area has a HomeController with an Index action:

    public override void RegisterArea(AreaRegistrationContext context) {
        context.MapRoute(
            "Admin_Index_default",
            "Admin/Index/{controller}/{action}/{id}",
            new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to count the length of a string with PHP. The string
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I've got a string that has curly quotes in it. I'd like to replace
I want use html5's new tag to play a wav file (currently only supported
I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build

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.