title: MVC ASP.NET Overloaded Controller Methods not working properly
body: <p>(Sorry if all these questions are stupid)</p>
  
  <p>I have two methods in my controller </p>
  
  <pre><code>[HttpGet]
  [Authorize]
  public ActionResult Pokemon(int id)
  {
      var user = db.PDCUsers
                   .SingleOrDefault(x =&gt; x.Username == User.Identity.Name);
      var pkmn = db.PlayerPkmns.SingleOrDefault(x =&gt; x.Id == id);
  
      return View(new DetailedPokemonViewModel(pkmn, user.Id, user.StepsIncMult));
  }
  </code></pre>
  
  <p>and</p>
  
  <pre><code>[HttpPost]
  [ChildActionOnly]
  [Authorize]
  public ActionResult Pokemon(int id, int steps)
  {
      var user = db.PDCUsers.SingleOrDefault(x =&gt; x.Username == User.Identity.Name);
      var pkmn = db.PlayerPkmns.SingleOrDefault(x =&gt; x.Id == id);
      if (pkmn.CurrentTrainerId == user.Id)
      {
          pkmn.Experience = pkmn.Experience + steps;
          db.SaveChanges();
      }
      return Pokemon(id);
  }
  </code></pre>
  
  <p>I'm calling the <code>Pokemon(int id, int steps)</code> from inside the <code>Pokemon(int id)</code> view by</p>
  
  <pre><code>&lt;a href="@Url.Action("Pokemon", "PokemonView", new { id = Model.Id, steps = 5000 })"&gt;walk&lt;/a&gt;
  </code></pre>
  
  <p>However, when I click the link the the <code>Pokemon(int id, int steps)</code>, it doesn't update the database value - and when I put a breakpoint in it doesn't register. I don't think I'm even hitting the method, but the url at the top has the steps parameter concatenated?</p>
  
  <p>All I'm trying to do is update the experience value of a data row by the amount of steps passed as a parameter. I don't want a new view (for now) - I just want it to show the Pokemon(int id) view again. </p>
  
  <p>Is there a best practice for calling a method then returning to the view it was called from? Also, is there any obvious reason why my database values aren't updating/breakpoint isn't being hit?</p>
  
  <p>Thanks</p>
  
  <hr>
  
  <p>Edit: </p>
  
  <p>By using <code>RedirectToAction</code> instead of returning the <code>Pokemon(int id)</code> method,
  and renaming the <code>Pokemon(int id, int steps)</code> to avoid overloading httpget issues, it works! </p>
  
  <p>Thanks!</p>