5

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?

AnonyMouse
  • 18,108
  • 26
  • 79
  • 131

2 Answers2

6

Set route values to null and your're good to go!

@Html.ActionLink("Home", "Index", "Invoice", null, new { id = "homelink" })
Per Kastman
  • 4,466
  • 24
  • 21
3

Description

Assuming i understand what you are asking for, there is an overload for that

Sample

@Html.ActionLink("LinkText", "ActionName", "ControllerName", 
                  null, new { id="homelink" })

More Information

dknaack
  • 60,192
  • 27
  • 155
  • 202