MVC - Areas and controllers


/ Published in: C#
Save to your folder(s)

If we're using areas, make sure that it only looks in the root controllers directory for root controllers


Copy this code and paste it in your HTML
  1. Route mapRoute = routes.MapRoute(
  2. "Default",
  3. "{controller}/{action}/{id}",
  4. new { controller = "Home", action = "Index", id = UrlParameter.Optional },
  5. new [] { "MvcAreasWindsor.Controllers.*" }
  6. );
  7.  
  8. //mapRoute.DataTokens["Namespaces"] = new[] { "MvcAreasWindsor.Controllers.*" };
  9. mapRoute.DataTokens["UseNamespaceFallback"] = false;

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.