Reorganizing an ASP.NET MVC folder structure

2019-07-31 03:05发布

问题:

I have several sections and subsections of my MVC site, which I would like to have the folder layout to be structured differently than the default structure. For example if I have 5 main sections of the site, I would like to have 5 folders and then the models views controllers folders within each of those. Does anyone have any recommendations how I would accomplish this maybe a different idea? And would I have to set up custom routing in my global.ascx file?

回答1:

Consider using Areas in MVC

http://msdn.microsoft.com/en-us/library/ee671793.aspx

http://devlicio.us/blogs/billy_mccafferty/archive/2009/01/22/mvc-quot-areas-quot-as-hierarchical-subfolders-under-views.aspx