码迷,mamicode.com
首页 > Web开发 > 详细

Ajax.BeginForm 防止跳转到新页面

时间:2015-05-14 20:11:19      阅读:433      评论:0      收藏:0      [点我收藏+]

标签:

@using (Ajax.BeginForm("ChangeCompanyId", "navigation", new { area = "configs" }, new AjaxOptions() { UpdateTargetId = "NavigationTree", OnSuccess = "InitTreeNode" }))
{
    @Html.DropDownList("CompanyId")
}
<link href="@Url.Content("~/Content/themes/Common/css/jquery.treeview.css")" rel="stylesheet" />
<div style="display: none;">
    @Html.CheckBox("IsBarringChildrens", (bool)ViewBag.IsBarringChildrens)
    <span>不含子导航
    </span>
</div>
<div id="NavigationTree">
    @Html.Action("TreeNode", new { CompanyId = (int)ViewBag.CompanyIdValue })
</div>

要引用下面的。

<script src="@Url.Content("~/Scripts/Common/jquery/jquery.unobtrusive-ajax.min.js")"></script>

Ajax.BeginForm 防止跳转到新页面

标签:

原文地址:http://www.cnblogs.com/chao2014/p/4504025.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!