How to determine if an arbitrary URL matches a defined route
问题 How can I tell if a string matches a particular named route? I have a route like this: routes.MapRoute( "FindYourNewRental", "find-your-new-rental/{market}/{community}.html", new { controller = "FindYourNewRental", action = "Community" } ); string url = "http://www.website.com/find-your-new-rental/northerncalifornia/sacramento.html" How can I programmatically tell if the 'url' string matches that route? Something like this: // matches url with the named route "FindYourNewRental" if