I'm currently using ASP.NET MVC 4 Routing with the LowercaseUrls
option set to true
and it's working great. I'm using this configuration:
routes.LowercaseUrls = true;
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new {
controller = "Inicio",
action = "Index",
id = UrlParameter.Optional
});
But in a particular set of actions, I have a string id
parameter that is encrypted and case-sensitive.
Then, when I try to generate an action link like this:
@Html.ActionLink("My Text", "Action", "Controller", new { id = encryptedString })
The id
parameter in the URL gets converted to lowercase resulting in an error while trying to decrypt the string.
Is it possible to configure routing to lower-case URLs ignoring URL parameters?