title: routes not work using jquery ajax calling in mvc
body: <p>i have a problem when i used custom routes.maps in mvc , when i clicked on login button it show a error 
  shown in below</p>
  
  <blockquote>
    <p>Server Error in '/' Application
    The resource cannot be found.
    Description: HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable.  Please review the following URL and make sure that it is spelled correctly. 
    Requested URL: /ValidLogin**</p>
  </blockquote>
  
  <p>but when i use <code>localhost:49257/Admin/Login</code>, it works properly. <code>localhost:49257/Admin-login</code>, it shows error as show above ....</p>
  
  <p>define custom routes below    </p>
  
  <pre><code>routes.MapRoute(
      name: "admin login",
      url: "admin-login",
      defaults: new { controller = "Admin", action = "Login", id = UrlParameter.Optional } );
  </code></pre>
  
  <p>Controller </p>
  
  <pre><code>public ActionResult Login()
  {
      return View();
  }
  
  public string ValidLogin(string username , string password)
  {
      DAOAdmin dao = new DAOAdmin();
      var login = dao.IsValidAdmin(username, password);
      if (login != null)
      {
          return "done";
      }
      else
      {
          return "failed";
      }
  }
  </code></pre>
  
  <p>javascript code below</p>
  
  <pre><code>$(function () {
      $("input[name='btn']").click(function () {
          var dt = $(".fm").serialize();
          $.ajax({
              url: 'ValidLogin',
              type: 'GET',
              data: dt,
              success: function (result) {
                  if (result.indexOf("done") &gt; -1) {
                      location.replace("admin-section");
                  } 
                  else if (result.indexOf("failed") &gt; -1) {
                  }
              }
          });
      });
  });
  </code></pre>
  
  <p>View Page</p>
  
  <pre><code>@using (Html.BeginForm("Vlogin", "Admin", FormMethod.Post, new { @class = "fm" }))
  {
      &lt;label for="UserName"&gt;Username&lt;/label&gt;&lt;br /&gt;
      @Html.TextBoxFor(a =&gt; a.username, new { @id = "txtuserid" })&lt;br /&gt;
  
      &lt;label for="Password"&gt;Password&lt;/label&gt;&lt;br /&gt;
      @Html.PasswordFor(a =&gt; a.password, new { @id = "txtpassword" })&lt;br /&gt;
  
      &lt;input type="button" name="btn" value="Login" /&gt;
      &lt;span id="result"&gt;&lt;/span&gt;
  }
  </code></pre>