title: JsonResult controller parameter always null
body: <p>I am using extremely similar code on another view and controller that is working perfectly but for some reason I cannot get this one to work. No matter what I do the controller parameters show undefined even though name and pass in the javascript are working correctly. Any help would be appreciated! </p>
  
  <pre><code>View:
  
  @using (Html.BeginForm())
  {
   &lt;fieldset&gt;
   &lt;legend&gt;User&lt;/legend&gt;
         Username:
              @Html.TextBox("txtUsername")
         &lt;br/&gt;
         Password:
              @Html.TextBox("txtPassword")
         &lt;br /&gt;
         &lt;p&gt;
              &lt;input type="submit" id="btnLogin" value="Login" /&gt;
         &lt;/p&gt;
   &lt;/fieldset&gt;
   }       
  
   &lt;script&gt;
  
   $(function() {
        $("#btnLogin").click(login);
   });
  
       function login() {
           var name = $('#txtUsername').val();
           var pass = $('#txtPassword').val();
  
       $.post("/User/Login/" + name + "/" + pass, null, loginSuccess, "json");
  }
  
  function loginSuccess(result) {
      alert(result);
  }
  
  &lt;/script&gt;
  
  
  Controller:
  
  public ActionResult Login()
  {
      return View("Login");
  }
  
  [HttpPost]
  public JsonResult Login(string name, string pass)
  {
      string result = "test result";
  
      return Json(result);
  }
  </code></pre>