我有以下動作的方法: - :即我是 剃刀視圖未顯示導航屬性值
<td>
@Html.DisplayFor(modelItem => Model.Description)
</td>
<td>
@Html.DisplayFor(modelItem => Model.Answer_Description.description)
</td>
<td>
@Ajax.ActionLink("Delete", "Delete", "Answer",
new { id = Model.AnswersID },
new AjaxOptions
{
Confirm = "Are You sure You want to delete this Answer ?",
HttpMethod = "Post",
UpdateTargetId = Model.AnswersID.ToString()
})
</td>
</tr>
問題 -
[HttpPost]
public ActionResult Create(int questionid, Answer a)
{
if (ModelState.IsValid)
{
repository.AddAnswer(a);
repository.Save();
return PartialView("_details",a);
}
return View(a);
和folloiwng _details partila視圖面對的是,@Html.DisplayFor(modelItem => Model.Answer_Description.description)
價值是不會自動顯示ajx調用後,除非我刷新網頁,所以可能是什麼問題?
我看到的原因是'UpdateTargetId'具有類似於'modelname.answerid'的值,但實際上應答描述的呈現ID是類似'Model.Answer_Description.description' – Rafay 2012-03-04 17:55:51