Hi. I have a controller named Content, which has an Index action, which is associated with a view.
I would like the simple route "content" to show me the index view of the content controller, so I use the following code (with the addition of the default site home route):
routes.MapRoute(
"ContentIndex",
"content",
new { controller = "Content", action = "Index"}
);
routes.MapRoute(
"Default",
"{controller}/{action}",
new { controller = "Home", action = "Index" }
);
when I type the url : "http://localhost/content/", I get an error 404 saying the resource cannot be found, but when I type "http://localhost/content/index", it shows the content index view. How can I get rid of the index in the url ?
Thanks !