0

I need to be able to create an id for a hyperlink. I have the following:

@Html.ActionLink("Delete", "Delete", new { id = @item.ID}, new {id = "deletelink"})

I was wondering, if there is any better way of doing this? Note that the id will be deletelink.

tereško
  • 58,060
  • 25
  • 98
  • 150
Nate Pet
  • 44,246
  • 124
  • 269
  • 414

1 Answers1

0

What are you looking for exactly? Are you not able to use this? This is the correct way to create an action link except that it looks malformed. You're not using the correct overload. You need to add in your controller name.

@Html.ActionLink("Delete", "Delete", "ControllerName", new { id = @item.ID}, new {id = "deletelink"})
CD Smith
  • 6,597
  • 7
  • 40
  • 66