title: ASP.NET MVC Html.ActionLink result URL - the way of encoding
body: <p>I create an amount of actions in MVC controllers.</p>
  
  <pre><code>public ActionResult DoSmth1(string token)
  public ActionResult DoAnother2(string token)
  </code></pre>
  
  <p>And when I have to call ActionLink..</p>
  
  <pre><code>=Html.ActionLink&lt;SomeController&gt;( x=&gt; x.DoSmth(item.property), item.property)
  =Html.ActionLink&lt;AnotherController&gt;( x=&gt; x.DoAnother(item.property), item.property)
  </code></pre>
  
  <p>...it generates me different URLs:</p>
  
  <pre><code>/Some/DoSmth/stringvalue
  /Another/DoAnother?property=stringvalue
  </code></pre>
  
  <p>Where to set the way it builds an URL? I am alr have no ideas...((</p>
  
  <hr>
  
  <p>OK, a got some waylight:
  - if the property names are the same that used in routing schema - eg controller,action and id - the MVC will <strong>always</strong> use the route builder (/c/a/id).</p>
  
  <p>That helps a little (so - <strong>name the parameter "id" as possible</strong>))</p>
  
  <p>But the overall problem is still valid...</p>
  
  <hr>
  
  <blockquote>
    <blockquote>
      <p>must be named the same as the token in the route</p>
    </blockquote>
  </blockquote>
  
  <p>Exactly - i first had that idea.</p>
  
  <p>But - now i have only default route ({controller}/{action}/{id}) but still have the URL with "property" in slashes... This is pretty weird.</p>
  
  <ul>
  <li>there's also a cheater way - to create a precise route that match a given controller with it's parameter names - is seems that will be the ultimate answer - but i still don't want to do this ((</li>
  </ul>