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?
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
its works like that
@Html.ActionLink("Projects", "ProjectDetails", "Project", new { href = "javascript:void(0)", @class = "has-arrow", @ariaexpanded = "false" })
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.