Limit controllers to specific area only
- by Andrej Kaurin
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[] { "GotSolution.WebSite.Areas.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).