我使用像这样的ajax形式:
@using (Ajax.BeginForm("Commit", "Product", new AjaxOptions
{
HttpMethod = "POST",
InsertionMode = InsertionMode.Replace,
OnSuccess = "OnSuccess",
}))
{
}
并且此代码在paartial view页面中显示一个列表:
<div class="containerHeadline" id="productlistview">
@{
Html.RenderAction(MVC.BaseInfo.Product.GetProductList());
}
</div>
和这个onsuccess函数:
function OnSuccess() {
$('#PopupModel').modal("hide");
}
&#13;
现在,我想要显示现在更新的加载html productlistview div。
我想要这样的东西:
$('#productlistview').load();
&#13;
答案 0 :(得分:0)
可以使用JavascriptResult
完成。
return JavaScript("window.location = 'http://listpage.com'");
或者只是刷新当前页面。
return JavaScript("location.reload(true)");
答案 1 :(得分:0)
如果您需要重新加载页面,则必须在代码
下使用 window.location.reload();
如果您想重新加载特定内容,则必须使用以下代码 在jquery
$("selector / classname / Id").load(window.location + " selector / classname / Id");