title: Get routing information about a URL
body: <p>I've got an ASP.NET MVC website that needs to display user-provided URLs stored in the DB. The way they're displayed will be different depending on how that URL would be routed if that URL refers to the website itself.</p>
  
  <p>For example, supposing the website is <em>foo.com</em>:</p>
  
  <ul>
  <li>URL stored in DB: foo.com/pie/3/nutrition
  <ul>
  <li>Controller is "pie"</li>
  <li>Action is "nutrition"</li>
  <li>ID is 3</li>
  </ul></li>
  </ul>
  
  <p>The way the link is formatted depends on all three of these.</p>
  
  <p>How would I extract this information correctly? Can I query the URL routing device?</p>
  
  <p>Note: "Use a regular expression" type of answers don't interest me -- the site, action, or controller names could change, the website may be accessible through multiple site names and ports, etc...</p>