There are 2 Home and Agree controllers in each of them, one Index method. In the view from the Home controller there is such a code.

 @Html.ActionLink("Click", "Index", "Agree") 

Which should reference the Index method from the Agree controller. However, when loading this view, this link appears

 <a href="/Agree">Click</a> 

Why is this coming out? Both methods without parameters. Default route

 public static void RegisterRoutes(RouteCollection routes) { routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); routes.MapRoute( name: "Default", url: "{controller}/{action}/{id}", defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional } ); } 

    1 answer 1

    This link leads to the Agree controller with an action - Index .

    ActionLink "shortens" the link, throwing out parameters from it with a value equal to the default. You have default values ​​for action - Index , and for controller - Home . Those.

    /Agree/Index will be reduced to /Agree

    /Home/Index will be reduced to /

    • Thank ! Accurately - Polyakov Sergey