Without creating my own ActionLink HtmlHelper is there a way to force any ActionLinks to be rendered lowercase?
Update: Check out the following links fo
The best way to handle this, is at the routing level. Force all route paths to be lowercase, and it will properly propagate to your action links etc.
The way I've solved this, is to create a new route class that inherits Route
and simply overrides the GetVirtualPath
method;
public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values)
{
var virtualPath = base.GetVirtualPath(requestContext, values);
if (virtualPath != null)
virtualPath.VirtualPath = virtualPath.VirtualPath.ToLowerInvariant();
return virtualPath;
}
I've also created a few extension methods for RouteCollection
to make it easy to use this new route class.