1

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 } // 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

2 Answers 2

2

Like this:

routes.MapRoute( 
    "Article", 
    "Article/{id}", 
    new { controller = "article", action = "article", id = UrlParameter.Optional } 
);
Sign up to request clarification or add additional context in comments.

Comments

-1
routes.MapRoute(
"Default", // Route name
"article/{action}/{id}", // URL with parameters
new { action = "article", id = UrlParameter.Optional } // Parameter defaults
);

1 Comment

This route would still be : /article/article/123

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.