No reference to Action



  • There are two controllers. Home and Agree in each one method Index♪ In a counter-residential presentation Home That's the code.

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

    Which should refer to the index method from the Agree counteraller. However, when this submission is downloaded, this reference appears

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

    Why does that come out? Both methods without parameters. Default roll

    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 }
        );
    }
    



  • This reference leads to counter-eller Agree action - Index

    ActionLink "highs" the reference, discarding the parameters with a default value. You have default values for actionIndexfor controllerHome♪ I mean.

    /Agree/Index reduced to /Agree

    /Home/Index reduced to /




Suggested Topics

  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2
  • 2