1
Vote

VirtualPath Method does not work on pages not being routed

description

line 45 in RoutingHelper.cs
 
Change method from:
 
public string VirtualPath ( string routeName, object values )
    {
        return (RequestContext != null)
            ? RouteTable.Routes.GetVirtualPath(RequestContext, routeName, new RouteValueDictionary(values)).VirtualPath
            : RouteTable.Routes.GetVirtualPath(null, routeName, new RouteValueDictionary(values)).VirtualPath;
    }
 
to:
 
public string VirtualPath ( string routeName, object values )
    {
        return (RequestContext != null)
            ? RouteTable.Routes.GetVirtualPath(RequestContext, routeName, new RouteValueDictionary(values)).VirtualPath
            : RouteTable.Routes.GetVirtualPath(null, routeName, new RouteValueDictionary(values)).VirtualPath;
    }
 
So pages that aren't routed can still create links to routed pages. also is RequestContext really needed at all? Not sure.....

comments