Mvc Basics: Controllers
I haven't been doing much Asp .net mvc lately so I have decided to do a series of short posts covering mvc fundamentals. They have to be short as I am typing them on my iPhone using the WordPress app.
Controllers are a fundamental concept in mvc. The inheritance chain is typically Icontroller -> BaseController -> Controller -> MyAppController. Mvc uses a bit of convention to find controllers in your .NET assemblies.
Controllers must satisfy the following criteria:
1. Implement IController
2. The controllers name must end with Controller
3. Must be public and not abstract
1. Implement IController
2. The controllers name must end with Controller
3. Must be public and not abstract
The one assumption that people commonly make is that the controller must be in the controllers folder. This is not true! The mvc controllers can be in any assembly referenced by your website as long a they satisfy the conditions listed earlier.