Html.BeginForm and HTML Attributes w/o specifying Controller and Action

ahsteele picture ahsteele · Nov 23, 2009 · Viewed 8.2k times · Source

I like the cleanliness of

using (Html.BeginForm())

And hate that adding HTML attributes requires specifying the controller, action, and form method.

using (Html.BeginForm("Action", "Controller", FormMethod.Post,
  new { id = "inactivate-form" })

Is there a way to use Html.BeginForm and specify HTML attributes for the form without manually wiring everything else up?

Answer

Simon Fox picture Simon Fox · Nov 23, 2009

Why would you not just use plain html?

<form id="inactivate-form" method="post" >
</form>