I am using Html.BeginForm but when trying to assign to it a class there is a problem. If i use class for the fourth place is fine. But if i try to use enctype in addition, there is a error. This is fine:
@using (Html.BeginForm("Edit", "Inventory", FormMethod.Post, new {enctype = "multipart/form-data"}))
But this is not:
@using (Html.BeginForm("Edit", "Inventory", FormMethod.Post, new {enctype = "multipart/form-data"}, new { @class = "listForm" } ))
And this is not:
@using (Html.BeginForm("Edit", "Inventory", FormMethod.Post, new { @class = "listForm" }, new {enctype = "multipart/form-data"}))
Any ideas please. Thank you
@using (Html.BeginForm("Edit", "Inventory", FormMethod.Post, new { @class = "listForm", enctype ="multipart/form-data" }) Try that
EDIT:
enctype and class are both htmlAttributes so you should place them in one anonymous object.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With