You can try writing your own route:
public class CustomRoute : Route { public CustomRoute(string url, RouteValueDictionary defaults, IRouteHandler routeHandler) : base(url, defaults, routeHandler) { } public override VirtualPathData GetVirtualPath(RequestContext requestContext, RouteValueDictionary values) { var path = base.GetVirtualPath(requestContext, values); if (path != null) { path.VirtualPath = path.VirtualPath.Replace("%20", "+"); } return path; } }
And register it as follows:
routes.Add( new CustomRoute( "{controller}/{action}/{id}", new RouteValueDictionary(new { controller = "Home", action = "Index", id = UrlParameter.Optional }), new MvcRouteHandler() ) );
source share