我在ajax请求中显示加载元素时遇到问题, 任何人都可以帮忙吗? 这是我的代码
@using (Ajax.BeginForm("Browse", "Item", new {category = "dropDownValue" }, new AjaxOptions{
InsertionMode = InsertionMode.Replace,
HttpMethod = "GET",
LoadingElementId = "loader",
UpdateTargetId = "divTable"
}))
{
@Html.DropDownListFor(m => category, new SelectList(category), "--select a category--", new { @class = "form-control", onchange="this.form.submit()"})
}
<div id="loader" style="display:none">
Loading...<img src="~/Content/gears.gif" />
</div>
答案 0 :(得分:1)
好吧,我想通了我用onchange ="this.form.submit()"
替换了onchange = "$(form).submit()"
,我忘了指定我的动作方法应该返回一个PartialView。