Adding CSS class to Html.BeginForm()

醉酒当歌 提交于 2019-12-02 16:04:19

There is an overload for that, if you supply the controller action, name, and form method.

@using (Html.BeginForm("ActionName", "ControllerName", 
            new { ReturnUrl = ViewBag.ReturnUrl }, 
            FormMethod.Post, new { @class="login-form" }))
{
  etc.
}
p4rds
Html.BeginForm("Index", "EIApplication", FormMethod.Post, new { enctype = "multipart/form-data", **@class = "nea-forms"** })

Or simply using html :

<form action="/ActionName/ControllerName" method="post" class="login-form">

</form>
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!