【发布时间】:2016-04-26 13:01:02
【问题描述】:
在第一个局部视图上,我有搜索功能,当用户单击搜索时,我想将结果刷新到第三个局部视图。
控制器:
public ActionResult Search()
{
virtualmodel vm = new virtualmodel();
return PartialView(svm);
}
[HttpPost]
public ActionResult Search(ViewModel svm)
{
// Query to retrive the result
// I am not sure what to return from here. Link to another action or just return back to same same partial
}
public ActionResult AnotherPartialPartial()
{
}
在主视图中
@{Html.RenderAction("Search", "Searchc");
}
怎么做?我需要ajax吗?
【问题讨论】:
-
如果您不想重新加载整个页面 - 那么您需要 ajax。如果你没问题 - 你可以使用常规形式的帖子
-
ajax 是最简单的方法。
-
绝对是ajax
-
尽管有些人真的试图帮助我,但我仍然无法找到可行的解决方案:(
-
@Nil 你解决了吗?如果你解决了,解决方案是什么?
标签: c# ajax asp.net-mvc asp.net-mvc-4 partial-views