
1:用ajax的方式实现异步加载子页面:
- function MasterPageJump(Url) {
- $.ajax({
- url: Url,
- type: "GET",
- success: function (response) {
- $('#mainContent').html(response);
- }
- });
- }
- 把跳转路径传入Url中就可以了
-
-
- 2:母版页再加一个Id
-
- <div id="main">
- @RenderBody()
- </div>
-
-
-
- 3:子页面
@{
ViewBag.Title = "子页面";
Layout = Request.IsAjaxRequest() ? null : "~/Views/MasterPage.cshtml";
}
评价
排名
31
文章
25
粉丝
11
评论
6
ICP备案 :渝ICP备18016597号-1
网站信息:2018-2025TNBLOG.NET
技术交流:群号656732739
联系我们:contact@tnblog.net
公网安备:
50010702506256


欢迎加群交流技术