我有这样的问题。我必须将 ContenuReponse 更新为数据库。鉴于 ContenuReponse,我有:
<div class="editor-field">
@Html.EditorFor(model => model.ContenuReponse)
@Html.ValidationMessageFor(model => model.ContenuReponse)
</div>
(我对文本框使用编辑视图的模板 MVC4 Internet App 的快递)并且在响应控制器中我有:
public ActionResult Reponse(int id = 0)
{
Question question = db.Questions.Find(id);
if (question == null)
{
return HttpNotFound();
}
return View(question);
}
[HttpPost]
public ActionResult Reponse(Question question)
{
}
我应该做什么
[HttpPost]
public ActionResult Reponse(Question question)
{
}
从 View 的文本框中获取值。有任何想法吗 ?非常感谢您的关注!