I want to replicate the following html using razor syntax:
<a href="index.html" data-description="I Want This Description">Home</a>
I know I would do this for the link:
@Html.ActionLink("Home", "Index", "Home")
How would I add the information that is within the html tag above “data-description=”I Want This Description”” ?
You can add html attributes by adding a parameter containing an anonymous object which contains the attributes and values you want.
Note the underscore instead of the hyphen. MVC automatically replaces the underscores with hyphens when the view is displayed.