but for some reason it includes the underscore in front of class: "_class". I can't simply say class because it's reserved but I thought this was the workaround? I've seen others try it in posts like :

Re: htmlAttributes and css class?

derikwhittaker

But i have found that when I do ... new { Class = "foo" } it will render out to ... class="foo".

The HTML helpers were all originally part of the MVC toolkit, and we've been going through cleaning them up. If you're seeing this particular behavior in some helper, it just means that we haven't gotten around to that particular helper yet. They are (or
at least *should be*) case sensitive, and you can't depend on the Class -> class behavior.