开发者

mvc3 routing not working as expected

开发者 https://www.devze.com 2023-04-12 07:22 出处:网络
I have default routes from mvc3 like {root}/account/details/12开发者_如何转开发3 and I want -

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

精彩评论

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