Some of our controllers are getting too large, so I am trying to simplify them by refactoring along the lines of:
Areas
Vehicles
Controllers
Cars
CarController.cs
Engines
PistonController.cs
...
Models
Views
Cars
EditCar.ascx
Engines
EditPiston.ascx
ShowPiston.ascx
Animals
...
(with namespaces matching the folder structure)
I've tried a few variations but can't get the MVC inference to recognise my project structure.
What does the partial view return look like in the action? Ie, EditPiston action with a simple return PartialView(piston)
wants to use a view Views-> Engines -> EditPiston.ascx
, not Views-> Cars->Engines -> EditPiston.ascx
.
Also, what do I need to do in the RegisterArea? Any specific routes I need to set up?