I create a simple MVC3 application and then I add in the following route to see if such a custom route works.
routes.MapRoute("self",
"route/{message}",
new { controller = "Route", action = "Message" }
);
And I use the following url
http://localhost:2554/Route/message
but it doesn’t work.
What does your
Messageaction look like? Does it take any parameters? What type are they?I suspect that you really want something that looks like:
with an action that looks like
so that the URL looks like http://localhost:2554/route/1 (or some other id)
Note that the order in which the routes are specified is important. This needs to come before the default route to be effective.