I have one Area and in AreaRegistration I defined namespace all controllers in area belongs to.
context.MapRoute(
"Admin_default",
"Admin/{controller}/{action}/{id}",
new { controller="Home", action = "Index", id = UrlParameter.Optional },
new[] { "MySite.Admin.Controllers" } // Namespaces
);
How to prevent controller in that area to be called even when not that route is matched. I.E. /home/index (without "admin" word at the beginning).
EXAMPLE:
If a have controller "MySite.Admin.Controllers.HomeController" which belongs to area root defined above. I want to forbid controller factory to search for that controller (i.e. throw exception) if it doesn't match route "Admin/{controller}/{action}/{id}" ("Admin" at the end). So if I type "home/index" (no "Admin" at the beginning) web site will throw an error that it can't find controller.
Hope i was clear enough.