在我的情况下,我需要一个模型来表达这样的视图:
@model EditFormApplication.Models.NewForm
@using (Html.BeginForm("EditForm", "Home", FormMethod.Post))
}
@Html.EditorFor(model => model.Field)
@Html.EditorFor(model => model.Field)
@Html.EditorFor(model => model.Field)
<input type="submit" value="save">
}
@Html.EditorFor(model => model.Field)可能更多,但它们都是一样的。我不知道这种情况的模型应该是什么:
namespace EditFormApplication.Models
{
public class NewForm
{
public string Field { get; set; }
}
}
我需要将填充的模型发送到 .视图中可以是无限数量的相同输入。Homecontroller
或者最好在不使用的情况下填充模型?EditorFor()
在控制器中,我只需要获得填充的模型
[HttpPost]
public ActionResult EditForm (NewForm model)
{
return View();
}
拉风的咖菲猫
相关分类