<p>I have a route</p>

<pre><code>// Sample URL: /Fixtures/Team/id
routes.MapRoute(
     "Fixtures-by-TeamID",
     "Fixtures/Team/{teamId}",
     new { controller = "Fixtures", action = "GetByTeamID", },
     new { teamId = @"\d{1,3}" }
);
</code></pre>

<p>and I am trying to use ActionLink in ASP.net MVC p5. </p>

<pre><code>&lt;%= Html.ActionLink(g.HomeTeam.TeamName, "Team", new { teamId = g.HomeTeam.TeamID })%&gt;
</code></pre>

<p>However it is not working and giving me </p>

<pre><code>&lt;a href="/Fixtures/Team?teamId=118"&gt;Team A&lt;/a&gt;
</code></pre>

<p>If I use Url.RouteUrl i get the correct link.</p>

<pre><code>&lt;a href="&lt;%=Url.RouteUrl("Fixtures-by-TeamID", new { teamId = g.HomeTeam.TeamID })%&gt;"&gt;&lt;%=g.HomeTeam.TeamName%&gt;&lt;/a&gt;   

&lt;a href="/Fixtures/Team/118"&gt;Team A&lt;/a&gt;
</code></pre>

<p>Any help would be great? Will this change in ASP.net MVC beta?</p>

<p>Thanks</p>

<p>Donald</p>

In my experience, the only time action routes really work properly is when you only have the single default route. As soon as you start adding custom routes like yours above, action routes become... I guess "finicky" is the right word. The matching system doesn't work exactly how you'd expect it to.
In this case, you said the action was "Team", but this route doesn't match an action of "Team", it only matches "GetTeamByID". So the routing system keeps going and ends up giving you a route based on the default route. The teamId isn't explicitly part of your default route, so it ends up as a query parameter tacked on the end.
MVC Beta has already shipped, and this behavior is unchanged.
Also, don't you find the named route to be clearer anyway? Personally, I do.
I even go one step further and actually create route helpers for all my custom routes, which might look like this in your current example:
```
```
<a href="<%= Url.FixturesByTeam(g.HomeTeam.TeamID) %>"><%= g.HomeTeam.TeamName %></a>
```
```
Or even:
```
```
<%= Html.LinkToFixturesByTeam(g.HomeTeam) %>
```
```
where you can pull the values for name and ID directly from the model.