title: ActionLink 404 Error
body: <p>Building my first ASP.NET MVC 3 application and trying to implement the ability to disassociate a given ice cream from a menu.  Each has an integer identifier associated with it and on a page I display these mappings and provide a link by them to remove the ice cream from the menu.</p>
  
  <p>I've got an <code>ActionLink</code> that looks like this:</p>
  
  <p><code>@Html.ActionLink("Remove", "RemoveMenuIceCreamMapping", "IceCream", new { iceCreamId=item.IceCreamId, menuId=item.MenuId}, null)</code></p>
  
  <p>In my IceCreamController I've got an Action that looks like this:</p>
  
  <pre><code>[HttpPost]
  public PartialViewResult RemoveMenuIceCreamMapping(int iceCreamId, int menuId)
  {
     ...
  }
  </code></pre>
  
  <p>Did a little searching and believe I may need to modify the <code>routes</code> in the Global.asax.cs file's <code>RegisterRoutes</code> to handle these two parameters.  So I tried this like so:</p>
  
  <pre><code>public static void RegisterRoutes(RoutesCollection routes)
  {
     routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
     // I added this route in an attempt to handle the two parameters:
     routes.MapRoute(
        "RemoveMenuIceCreamMapping", // Route name
        "IceCream/RemoveMenuIceCreamMapping/{iceCreamId}/{menuId}", // URLwith parameters
        new
        {
           controller = "IceCream",
           action = "RemoveMenuIceCreamMapping",
           iceCreamId = UrlParameter.Optional,
           menuId = UrlParameter.Optional
        } 
     );
  
     // this was there by default
     routes.MapRoute(
        "Default",
        "{controller}/{action}/{id}",
        new {controller = "Home", action = "Index", id = UrlParameter.Optional }
     };
  }
  </code></pre>
  
  <p>But this doesn't work - I get a "The resource cannot be found." error, 404.  Requested URL: /IceCream/RemoveMenuIceCreamMapping/1/10</p>
  
  <p>1 is the Id of the IceCream and 10 is the menu's Id.</p>
  
  <p>What I was expecting to happen was that the action <code>RemoveMenuIceCreamMapping</code> would get called, passing those two parameters, but I'm obviously not doing something right here and may just misunderstand how to accomplish what I want and be going about this the wrong way.  Any guidance would be most appreciated.</p>
  
  <hr>
  
  <p><strong>Update</strong></p>
  
  <p>So, one more thing I've learned, after reading <a href="https://stackoverflow.com/questions/4281390/passing-parameters-from-textboxes-in-a-view-to-a-controller-in-asp-net-mvc2">this SO question</a>, my <code>ActionLink</code> isn't triggering a POST so removing the <code>[HttpPost]</code> from the action seemed like the right thing to do.  And, in fact, as soon as I did that, the route was found and the action executed.</p>