1

I have the follow folder strucutre as default when creating a MVC project in Visual Studio:

.
├── content 
├── controllers
│   └── home
├── models 
└── views
    ├── account
    └── home
        └── index.aspx  

I want to create a similar structure but WITHIN an admin folder like so:

admin
├── content 
├── controllers
│   └── home
│       └── controller
├── models 
└── views
    ├── account
    └── home
        └── index.aspx

When I try to link to /admin/home it says it can't be find. Is this method of nesting even possible?

1 Answer 1

6

I think what you want is an "Area", just right click your project and select add -> Area and name it admin. That will create following structure:

Areas
->admin
 ->controllers 
 ->models
 ->views 

You might also want to checkout these sites:

both should offer a good overview of the areas concept.

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

2 Comments

the server still can't find the folders in the area?
:) and you have to specify the routes specific to that area in *AreaRegistration.cs, and there should be a default route in there.

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.