I am new to ASP.NET MVC and when I tried to host my working application into IIS, the routing fails as I now requires the application name in front of my controller name.
Eg. my default page navigates using:
localhost/ControllerName/Index
However after hosting:
ipaddress/ApplicationName/ControllerName/Index
It now requires the ApplicationName
before my controller.
I tried adding an additional MapRoute:
routes.MapRoute(
name: "ApplicationName",
url: "ApplicationName/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
However it still navigates to the defaults.
How do I have the routing table skip the application name?