@Ajax.BeginForm LoadingElementId 不起作用
@Ajax.BeginForm LoadingElementId does not work
我在 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>
好的,我想通了,我用 onchange = "$(form).submit()"
替换了 onchange ="this.form.submit()"
并且我忘记指定我的操作方法应该 return 一个 PartialView。
我在 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>
好的,我想通了,我用 onchange = "$(form).submit()"
替换了 onchange ="this.form.submit()"
并且我忘记指定我的操作方法应该 return 一个 PartialView。