Vis*_*hal 71 .net css forms html-helper asp.net-mvc-4
如何为以下情况添加类属性(仅使用ReturnUrl):
@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl }))
{
}
Run Code Online (Sandbox Code Playgroud)
我想要这样的东西:
@using (Html.BeginForm(new { ReturnUrl = ViewBag.ReturnUrl }, new { @class = "login-form" }))
{
}
Run Code Online (Sandbox Code Playgroud)
Hac*_*ese 146
如果您提供控制器操作,名称和表单方法,则会出现重载.
@using (Html.BeginForm("ActionName", "ControllerName",
new { ReturnUrl = ViewBag.ReturnUrl },
FormMethod.Post, new { @class="login-form" }))
{
etc.
}
Run Code Online (Sandbox Code Playgroud)