How can I add a class attribute to an HTML element generated by MVC’s HTML Helpers?

ASP.NET MVC can generate HTML elements using HTML Helpers, for example @Html.ActionLink(), @Html.BeginForm() and so on. I know I can specify form attributes by creating an anonymous object and pass that object for the (fourth in this case) htmlAttributes parameter where specifying an id for the element: Html.BeginForm(“Foo”, “Bar”, FormMethod.Post, new { id = “MyForm”}) … Read more