开发者

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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜