我有
public PartialViewResult CodePartial(string code){
...
return PartialView("anotherpartial");
}
其中有提交按钮,我希望在发布后执行另一个部分部分视图结果。但相反,它会在CodePartial视图中返回这个局部视图。并且在调试时它不会进入另一个部分动作。我该如何改进呢?
代码部分.cshtml
@model Kubeti.Models.Codes
@using (Ajax.BeginForm("CodePartial", new AjaxOptions { HttpMethod = "POST", UpdateTargetId = "result", InsertionMode = InsertionMode.Replace }))
{
@Html.EditorFor(x => x.code)
@Html.ValidationMessageFor(x => x.code)
<input type="submit" value="OK" />
}
<div id="result" style="width: 500px; height:500px; border:1px solid red;">
索引.cshtml
@Html.Partial("CodePartial")
@Html.Partial("anotherpartial")