I can not figure out why ActionLink is not generating the url correctly in this one instance.
I have a controller called Activity and a view called Show. From there I'm trying to create a link to the ServiceCall controller, Show view. From within any view on the ServiceCall this works fine:
<%= Html.ActionLink(Html.Encode(sc.CallNumber), "Show", new { callNumber = "100" })%>
From the Activity view, this is not working:
<%= Html.ActionLink(Html.Encode(sc.CallNumber), "Show", "ServiceCall", new { callNumber = "100" })%>
It is generating a link like http://localhost/Activity/Show/12?Length=11
After some research I decided to try this:
<%= Html.ActionLink(Html.Encode(sc.CallNumber), "Show", new { controller = "ServiceCall" }, new { callNumber = "100" })%>
That gives me a url of http://localhost/ServiceCall/Show but does not give the callNumber. Any ideas?
This is in my routes:
routes.MapRoute(
"ShowCall",
"ServiceCall/Show/{callNumber}",
new {controller = "ServiceCall", action = "Show", callNumber = ""}
);