I have the following action link in a view for shows at for example /Shows/Details/1
<%= Html.ActionLink(item.venue, "Details", "Venues", new { name = item.venue }) %>
This displays the name of the Venue the show is being played at, but I need it to link to the Venue instead of the Shows controller as at the moment the url it is creating is /Shows/Details?Length=6 when it needs to go to /Venues/Details?Name=VenueName
The name of the controller for Venues is VenuesController.
Thanks
You are using the wrong overload for the
.ActionLink. Try this instead…It is currently selecting
string, string, object, objectoverload. Your “Venues” string is being used for routing data.