Hi,
I know I can specify form attributes this way:
Html.BeginForm("DoSearch", "Search", FormMethod.Post, new { id = "MyForm"}))
But what about class attributes? Obviously this does not work:
Html.BeginForm("DoSearch", "Search", FormMethod.Post, new { class = "myclass"}))
I've also tried
new { _class = "myclass"}
and
new { class_ = "myclass"}
but it did not work.
Disclaimer: Yes, I know that I can just as well use a good old <form>
element or wrap the form inside a <div class="...">
, but I'd still be interested to know how it is supposed to be done.