0
我有一个部分视图和控制器HTTPPOST操作的问题:当我在HTTPPOST到我的partialview时,只有部分返回,不是索引页与partialview。部分视图和HTTPPOST动作
我不明白为什么!
上下文:
我有报价(与视图模型相关联),4个部分组成:客户端,游泳池,封面,简历 我想作的观光和partialview单页上,一个每部分。
代码在我的视图(提供/指数):
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Index</h2>
<% Html.RenderAction("P_Client"); %>
</asp:Content>
代码在我的控制器:
公共类OfferController:控制器 {
public ActionResult Index() {
return View();
}
[HttpGet, ChildActionOnly]
public ActionResult P_Client(string id)
{
blablabla
return PartialView("P_Client", viewmodel);
}
[HttpPost]
public ActionResult P_Client(OfferViewModel ViewModel)
{
return PartialView(ViewModel);
}
}
}
它无法正常工作,无限调试循环HttpPost ActionResult P_Client! – Akawan 2010-10-07 10:10:29
好的。尝试用RedirectToAction(“Index”)替换该行 – Clicktricity 2010-10-07 10:19:07