I try to convert this HTML link
Projects
into MVC code, but I don't know how to add the href and the aria-expanded attributes
@Html.ActionLink("Project", "ProjectDetails", "Project", new { @class = "has-arrow" })
Can anyone help please?
CodePudding user response:
You can do the following to your ActionLink:
@Html.ActionLink("Projects", "ProjectDetails", "Project", new {href="javascript:void(0)", @class = "has-arrow", @aria-expanded="false"})
This will convert to your a tag in the question
CodePudding user response:
its works like that
@Html.ActionLink("Projects", "ProjectDetails", "Project", new { href = "javascript:void(0)", @class = "has-arrow", @ariaexpanded = "false" })
