How to call the Route Name in Html.ActionLink asp.net MVC?
I have this route
routes.MapRoute(
"ViewGame开发者_开发知识库s", // Route name
"psp/{controller}/{action}", // URL with parameters
new { controller = "Games"} // Parameter defaults
);
and I used <%= Html.ActionLink("God of War", "godofwar", "Games")%>
all though it gives me a link like this somesite.com/psp/games/godofwar/
but the other link became also like that for example my homecontroller became this somesite.com/psp/home/about/
?
how can call the routename so other won't have the ViewGames route?
I dont want to try this <a href="/psp/games/godofwar/">
which is not good.. .
You explicitly call a route using
<%: Html.RouteLink("link_text", "route_name", route_parameters) %>
All the overloads for Html.RouteLink are here
精彩评论