我有一个Ajax.Routeform,其systax给出为:`
@using (Ajax.BeginRouteForm("Contact", new AjaxOptions { HttpMethod = "POST", OnSuccess = "emailSuccess", OnFailure = "emailFailure" }))
{
}
我需要在其中添加一个“form-horizontal”的html类。我怎样才能做到这一点?
包含html属性的方法重载是
Ajax.Routeform( string routeName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes )
`
答案 0 :(得分:0)
htmlAttributes的方法重载是
Ajax.Routeform( string routeName, object routeValues, AjaxOptions ajaxOptions, object htmlAttributes )
由于不需要routeValues,我可以在其中传递null并且语法非常直接
@using (Ajax.BeginRouteForm("Contact", null, new AjaxOptions { ... }, new { @class = "form-horizontal" }))