How do move controllers that's not in an area to an area?
I started programming with MVC3 without any knowledge of areas. As the application grows bigger, I would like to use areas to organize m开发者_如何学运维y code, but most of my controllers are not inside any areas at all.
How do I quickly move an existing controller into an area?
Create an Area, move your controller class file into the the Controllers
folder of that area and then edit your controller namespace to match the Area
. Then move your views into the area Views
directory.
But be aware you have to update all links to that controller by having the area name in the URL.
精彩评论