title: Get ID from URL in an action from a controller with ASP .NET?
body: <p>I work asp.net MVC, I call an action (let's call it <em>MyAction</em>) from <em>MyController</em> while I'm at the following <strong>url www.mywebapp.com/MyController/AnotherAction/123</strong></p>
  
  <p>I need to get the <strong>123</strong> in <em>MyAction</em>, so I started to do something like this :</p>
  
  <pre><code>var url = Request.Url;
  </code></pre>
  
  <p>In order to parse it then get the ID.</p>
  
  <p>But I'm not sure if it's the "best" way to do it. Do you know how can I get the ID from the current URL when I am in <em>MyAction</em> properly and safely ?</p>