2017-04-04 42 views
0

我使用两种布局 1-主要布局:“〜/ Views/Shared/_Layout.cshtml”012-2-左侧布局“〜/ Views/Shared/_LeftSide.cshtml”(这一观点也包含主要布局)渲染部分无需重新加载布局MVC

在左侧布局我使用的渲染部分“Section01” enter image description here

点击链接一号ABC之后?我有这样的看法0101 enter image description here

但是目前它的回帖完整页面。 我想渲染节不重新布局布局。任何机构请帮助,或任何其他建议来实现这一目标?从左侧部位项的点击

+0

在'_LeftSide.cshtml'删除轮廓线。 – pookie

+0

你需要对你的控制器做一个ajax请求,它只是返回你需要的部分 – Pete

回答

0

使用Ajax请求加载布局2

$.ajax({ 
      url: '/yoururl/layout2', 
      dataType: 'html', 
      type: 'GET' 
      success: function(data) { 
      $('#layout2Div').html(data); 
      } 
    });