title: Problems with Url.Action helper with multiple route values
body: <p>I'm currently developing an ASP.NET MVC3 application in VS2010 and I'm having some troubles with <code>@Url.Action</code> helper. I have an ajax request where I use this helper:</p>
  
  <pre><code>var url = '@Url.Action("Action", "Controler", new { a = "a", b = "b" })';
  $.post(url).success(function(data) { 
      ... 
  });
  </code></pre>
  
  <p>The problem is that the value of <code>url</code> after this is <code>/Controller/Action?a=a&amp;amp;b=b</code>, note the <code>&amp;amp;</code> between the route values. This isn't working, but if I do:</p>
  
  <pre><code>var url = '@Url.Action("Action", "Controler", new { a = "a", b = "b" })'.replace('amp;', '');
  </code></pre>
  
  <p>it works perfectly!!!</p>
  
  <p>My action is something like this:</p>
  
  <pre><code>public JsonResult Action(string a, string b) 
  {
      ...
  }
  </code></pre>
  
  <p>I have debugged my app and the action gets called and even <code>a</code> is <code>"a"</code>, but <code>b</code> is <code>null</code>.</p>
  
  <p>Is this the desired behavior of <code>Url.Action</code>? I don't think so. Please help me, what am I doing wrong? Should I add another parameter to my <code>Url.Action</code> call? Thanks in advance.</p>