ASP.Net MVC: Areas and controllers
- by xamlnotes
Areas are a great feature of MVC now. The let you put common code into an Area and then its segregated from other code. That makes it really easy to put those common feature in one spot and not have the interfere with other code. So today I was working on a new area and starting to test code in it. But the controller method could not be found. Testing the routes and all of the names proved no help either. So I am banging my head against the wall. Then I took a peak at one of the existing controllers in another Area in the same app. Looked similar, but … There was a Namespaceat the top of that controller with that Area in the Namespace. I had copied my controller in from somewhere else and therefore it did not have the Namespace there. I put in the right Namespace and cool, it worked right away. So add that to your list when testing.