You could try inverting the routes definition by placing the more specialized route first. Also you probably didn't want to hardcode the action name as action but rather use the {action}
placeholder:
public class RouteConfig
{
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
//routes.MapMvcAttributeRoutes();
routes.MapRoute(
name: "Special",
url: "{action}",
defaults: new { controller = "Home", action = "LandingIndex" }
);
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
}
Follow the below links :
Link 1
Link 2
Link 3
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…