如何在Html.Beginform

时间:2017-10-27 06:24:29

标签: c# asp.net-mvc razor

我只能

@using (Html.BeginForm("Method", "Controller", FormMethod.Post, new AjaxOptions{LoadingElementId = "ajaxLoaderBig" }))

或者

@using (Html.BeginForm("Method", "Controller", FormMethod.Post, new {@class = "class", @id = "id1"}))

如何实现

@using (Html.BeginForm("Method", "Controller", FormMethod.Post, new AjaxOptions{LoadingElementId = "ajaxLoaderBig" }, new {@class = "class", @id = "id1"}))

我只想为html.beginform添加一个加载元素,因为使用了AjaxOption

1 个答案:

答案 0 :(得分:2)

使用Ajax.BeginForm

@using (Ajax.BeginForm("Method", "Controller", null, new AjaxOptions() { LoadingElementId = "ajaxLoaderBig" },  new {@class = "class", @id = "id1"}))