I think you're looking for a way to get the route values from a given URL. Here's some code that might help you do this with a URL string. Just note that I put a IRouteRegistrant interface that just has a Register function that takes a route collection. Basically replace that with your registration mechanism.
public static RouteData GetRouteValues(IRouteRegistrant registrant, string url)
{
var routes = new RouteCollection();
registrant.Register(routes);
var context = new FakeHttpContext(url);
return routes.GetRouteData(context);
}
So to get at the values (for your param example) you just need the following:
public static void MyFn()
{
var values = GetRouteValues(....., "~/Edit/5");
var paramValue = values.Values["param"];
.....
}
Hope this helps.