 分类:
    MVC
    
    分类:
    MVC
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"; 
}
评价
    
                    排名
                
                
                    6
                
            
                    文章
                
                
                    6
                
            
                    粉丝
                
                
                    16
                
            
                    评论
                
                
                    8
                
            
            {{item.articleTitle}}
            
    {{item.blogName}} : {{item.content}}
        
            ICP备案  :渝ICP备18016597号-1
        
        
            网站信息:2018-2025TNBLOG.NET
        
        
            技术交流:群号656732739
        
        
            联系我们:contact@tnblog.net
        
        
            公网安备: 50010702506256
50010702506256
        
     50010702506256
50010702506256
         
        
            欢迎加群交流技术
        
     
         
         
        