How to make the controllers and actions routes all in lowercase?
For example: instead of Noticias/Details
get noticias/details
.
How to make the controllers and actions routes all in lowercase?
For example: instead of Noticias/Details
get noticias/details
.
You can use a library ( Nuget ) to do this. Here are the instructions on how to install and use it.
But if you are using .Net 4.5 or higher, you can configure it without libraries:
public static void RegisterRoutes(RouteCollection routes) {
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.LowercaseUrls = true;
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);
}
Retired from answer in SO . In the same question you have other ways to do this.