views:

48

answers:

2

Hi all;


alt text

Global.asax Code:

routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "article", action = "article", id = UrlParameter.Optional } // Parameter 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

A: 
routes.MapRoute(
"Default", // Route name
"article/{action}/{id}", // URL with parameters
new { action = "article", id = UrlParameter.Optional } // Parameter defaults
);
Leandro Lancelotti
This route would still be : /article/article/123
Mark
@Leandro Lancelotti, Not work your code
Oraclee
+2  A: 

Like this:

routes.MapRoute( 
    "Article", 
    "Article/{id}", 
    new { controller = "article", action = "article", id = UrlParameter.Optional } 
);
Mark
Yes, work thank you @Mark
Oraclee