Asp.net mvc 2 如何更改ActionLink行为?

Asp.net mvc 2 如何更改ActionLink行为?,asp.net-mvc-2,routes,Asp.net Mvc 2,Routes,作为MVC 2的新手,我们如何获得以下链接: http://localhost:13269/Terms 反而 http://localhost:13269/Frontend/Terms 这是由于: <%: Html.ActionLink("Terms & Conditions", "Terms", "Frontpage")%> 作为新路由定义尝试此操作。在默认路由之前声明此操作 routes.MapRoute( "DefaultFontEnd", // Rout

作为MVC 2的新手,我们如何获得以下链接:

http://localhost:13269/Terms
反而

http://localhost:13269/Frontend/Terms
这是由于:

<%: Html.ActionLink("Terms & Conditions", "Terms", "Frontpage")%>

作为新路由定义尝试此操作。在默认路由之前声明此操作

routes.MapRoute(
    "DefaultFontEnd", // Route name
    "{action}/{id}", // URL with parameters
    new { controller = "Frontend", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);
routes.MapRoute(
    "DefaultFontEnd", // Route name
    "{action}/{id}", // URL with parameters
    new { controller = "Frontend", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);