I have the following route:
routes.MapRoute(
"PlayerSearch",
"Players/{playername}",
new {controller = "Players", action = "Get"});
This works if I go to http://mydomain/players/playername.
I also have a form that allows users to look up players by name:
<% using (Html.BeginForm("Get", "Players"))
{
%>
<%=Html.Label("player name")%>
<%=Html.TextBox("playername")%>
<input type="submit" value="submit" />
<%
}%>
This works but the URL is now http://mydomain/players/Get. I want it to be the same URL as the direct URL above. I'm sure this is ignorance (and probably a duplicate but I can't find it) on my part but I just can't get it to work. How do I use routing to get the form to display the desired URL?