I have been trying to do an actionlink like:
<li>@Html.ActionLink("Home", "Index", "Invoice", new { id = "homelink" })</li>
So what I have is linkText, an actionname, a controller name and an id for the link.
However there is no signature that matches this. The closest one has routevalues between the controller name and the htmlattributes. I don't have any routevalues I need to put in there though.
Can someone please tell me how to best get around this?
Set route values to null
and your're good to go!
@Html.ActionLink("Home", "Index", "Invoice", null, new { id = "homelink" })
Assuming i understand what you are asking for, there is an overload for that
@Html.ActionLink("LinkText", "ActionName", "ControllerName",
null, new { id="homelink" })
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With