You can put your Controllers anywhere in the project. As long as it gets compiled into the dll. The only problem with splitting them up is that if you have 2 controllers with the same name in different namespaces the ControllerFactory wont know which one to create unless you specify the namespace in the route
routes.MapRoute(
"NewsSender.Mailings",
"{controller}/{action}/{id}",
new {controller = "Mailings", action = "Index", id = ""} /* defaults */,
new {controller = "Mailings|Contacts|..." } /* constraints */,
new [] { "App.Controllers.NewsSender" } /* namespaces */
)
The Views can be anywhere as well... as long as the ViewEngine knows where to look. For example you can override the OnResultExecuting method on the Controller and set the view location formats on the View Engine as follows
public class MailingsController:Controller
{
protected override void OnResultExecuting(ResultExecutingContext filterContext)
{
var result = filterContext.Result as PartialViewResult;
if( result == null ) return;
var viewEngine = result.ViewEngine = new WebFormViewEngine();
var prefix = "~/Views/" + moduleName + "/{1}/{0}";
var prefixShared = "~/Views/" + moduleName + "/Shared/{0}";
viewEngine.MasterLocationFormats = new [] { prefix + ".master", prefixShared + ".master" };
viewEngine.ViewLocationFormats = new [] { prefix + ".aspx", prefix + ".ascx", prefixShared + ".aspx", prefixShared + ".ascx" };
viewEngine.PartialViewLocationFormats = viewEngine.ViewLocationFormats;
}
...
In the location formats above, {0} is replaced with the view name, and {1} is replaced with the controller name. You might want to put this logic into a common base controller class so you don't have to repeat it everywhere.