Asp.net Mvc Routing problem
alt text http://img243.imageshack.us/img243/3249/50263677.jpg
Global.asax Code:
routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "article", action = "article", id = UrlParameter.Optional } // Par开发者_StackOverflow中文版ameter defaults
);
I want to use url routing like this:
www.domainname.com/Article/123/bla_article
how can ı do this ?
This work: www.domainname.com/article/article/123
this not work: www.domainname.com/article/123
please Help
Like this:
routes.MapRoute(
"Article",
"Article/{id}",
new { controller = "article", action = "article", id = UrlParameter.Optional }
);
routes.MapRoute(
"Default", // Route name
"article/{action}/{id}", // URL with parameters
new { action = "article", id = UrlParameter.Optional } // Parameter defaults
);
精彩评论