开发者

mvc3 routing not working as expected

I have default routes from mvc3 like

{root}/account/details/12开发者_如何转开发3

and I want -

{root}/a/123

I tried this -

    routes.MapRoute(
        "Accounts_details", // Route name
        "a/{id}", // URL with parameters
        new { controller = "account", action = "details", id = UrlParameter.Optional } // Parameter defaults
        );

But it still gives me 404. What am i doing wrong?

Thanks.


Where this route is located? Is it's after the default route try to write it before default route.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜