I have Edit Action with Html.BeginForm
. How can I add HTML attributes?
I know only one way:
@using (Html.BeginForm("Edit", "Clients", FormMethod.Post, new { @class="example"})) {
}
but if I use this method I cannot pass current ID
Is it possible to add HTML attributes to form without modifying action URL?
FormMethod.Get
or whatever instead ofFormMethod.Post
here if you want to. – Sergey Kudriavtsev Jun 10 '12 at 21:42@using (Html.BeginForm("Edit", "Clients", FormMethod.Post, new { @class="example", id = Model.Id}))
Is this you are looking for or what is the exact problem? – Abhijit-K Jun 11 '12 at 11:56