0

My controller is being hit when the area is not specified in the URL:

https://localhost:441/wholesale_signup and it won't find the view and throw an error.

How do I prevent that controller from being hit in the first place so it just 404s?

It should only be hit when the area and controller is provided: https://localhost:441/customerservice/wholesale_signup

billy kong
  • 67
  • 1
  • 1
  • 7

1 Answers1

0

So I think I wasn't sure how to word my question, but after a few hours of searching I found the solution:

ASP.NET MVC 2 RC 2 returns Area-specific controller when no area specified

routes.MapRouteLowercase(
    name: "Default",
    url: "{controller}/{action}/{id}",
    defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
    namespaces: new[] { "Default.Controller.Namespace" }
).DataTokens["UseNamespaceFallback"] = false; ;
billy kong
  • 67
  • 1
  • 1
  • 7