简体   繁体   中英

How to organize MVC3 project in custom folders

I'm starting to learn MVC3 and I'd like to know if it is advisable to group your views and controllers in folders different to the default ones.
So I could organize the project such as:

-->ClientsFolder
-Views
----ClientsAdmin(Folder)
------View1
------View2
------View3
----ClientInvoices(Folder)
------View1
------View2
------View3
-Controllers
----ClientsAdminController(File)
----ClientsInvoiceController(File)
-->EmployeesFolder
Etc..
Etc..
I'd like to know, if it is a common practise, how should I start to adapt the project to this structure or if somebody could point me to a tutorial which could help me started.

Thanks

What you are describing is a feature MVC 3 already has (since MVC 2 I think). Areas .

Walkthrough: Organizing an Application using Areas

UPDATE: New working link.

What you are doing is fine. There's no need for a new area for every controller, areas should be for large chunks of application that aren't really the main application (like an administration site for your main site). This is an OK tutorial to get started MVC Movie Tutorial

There are Areas for arrange mvc project.
Don't invent the wheel again... =)

ASP.NET MVC has a facility to partition Web applications into smaller units with areas .

For example you can create an admin area for the administration section.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM