0

My routes :

    public static void RegisterRoutes(RouteCollection routes)
    {
        routes.IgnoreRoute("{resource}.axd/{*pathInfo}");

        //Add a custom Route that implements IRouteHandler
        Route metadata = new Route("metadata", new MetadataRoute());
        routes.Add("Metadata",  metadata);

        routes.MapRoute(
            name: "Default",
            url: "{controller}/{action}/{id}",
            defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
        );
    }

My view : @Html.ActionLink("Home", "Index", "Home")

The desired client html : href="/"

The actual client html : href="/metadata?action=Index&controller=Home"

Is there a way to get Html.ActionLink to disregard the metadata route?

Thanks

1 Answers1

0

I found this Custom IRouteHandler route screws up MVC link building Its not a graceful solution but it actually worked. I was shocked.

Community
  • 1
  • 1