How to implement User routing like that in StackOverflow ?
- by rockinthesixstring
I've looked at the routing on StackOverflow and I've got a very noobie question, but something I'd like clarification none the less.
I'm looking specifically at the Users controller
http://stackoverflow.com/Users
http://stackoverflow.com/Users/Login
http://stackoverflow.com/Users/124069/rockinthesixstring
What I'm noticing is that there is a "Users" controller probably with a default "Index" action, and a "Login" action. The problem I am facing is that the login action can be ignored and a "UrlParameter.Optional [ID]" can also be used.
How exactly does this look in the RegisterRoutes collection? Or am I missing something totally obvious?
EDIT: Here's the route I have currently.. but it's definitely far from right.
routes.MapRoute( _
"Default", _
"{controller}/{id}/{slug}", _
New With {.controller = "Events", .action = "Index", .id = UrlParameter.Optional, .slug = UrlParameter.Optional} _
)