【发布时间】:2013-09-17 12:01:24
【问题描述】:
我有类似的东西
@using (Ajax.BeginForm("Next", "Controll", null, new AjaxOptions() { UpdateTargetId = "updateRegion", InsertionMode = InsertionMode.Replace, HttpMethod = "GET" }))
{
<div id="updateRegion">
@Html.Partial("_callingFromPartial", Model.List[0])
</div>
}
@Html.RadioButtonFor(item => Model.OptionSelected, Model.IdOption, new { id = "select" + Model.IdOption })
<label>@Model.OptionText</label>
<input type="submit" value="Next"/>
[HttpGet]
public ActionResult Next(Bu.Models.ChoiceQuestion itemReturn)
{
CurrentItem = Itens[refe+1];
return PartialView("_callingFromPartial", CurrentItem);
}
但它并没有像我想要的那样工作,我正在尝试在#updateRegion 中加载下一个内容,但它显示“找不到资源”。 ,这有什么问题吗?
【问题讨论】:
-
问题是表单中的“method='post'”默认值,现在我用 'Ajax.BeginForm("Next", "Controll", null, new AjaxOptions() { UpdateTargetId = "updateRegion", InsertionMode = InsertionMode.Replace, HttpMethod = "GET", new {method = "get"} }' 它正在工作,但是,它仍然在干净的文档页面中显示结果.
标签: asp.net-mvc