ASP.NET MVC: Html.Actionlink() generates empty link.
- by wh0emPah
Okay i'm experiencing some problems with the actionlink htmlhelper.
I have some complicated routing as follows:
routes.MapRoute("Groep_Dashboard_Route", // Route name
"{EventName}/{GroupID}/Dashboard", // url with Paramters
new {controller = "Group", action="Dashboard"});
routes.MapRoute("Event_Groep_Route", // Route name
"{EventName}/{GroupID}/{controller}/{action}/{id}",
new {controller = "Home", action = "Index"});
My problem is generating action links that match these patterns.
The eventname parameter is really just for having a user friendly link. it doesn't do anything.
Now when i'm trying for example to generate a link. that shows the dashboard of a certain groep.
Like:
mysite.com/testevent/20/Dashboard
I'll use the following actionlink:
<%: Html.ActionLink("Show dashboard", "Group", "Dashboard", new { EventName_Url = "test", GroepID = item.groepID}, null)%>
What my actual result in html gives is:
<a href="">Show Dashboard</a>
Please bear with me i'm still new at ASP MVC. Could someone tell me what i'm doing wrong?
Help would be appreciated!