MVC 3剃须刀布局 [英] MVC 3 razor layout

查看:169
本文介绍了MVC 3剃须刀布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有我的所有网页使用_Layout.cshtml作为母版页中MVC 3项目。现在我想从页(progress.cshtml)之一删除该母版页(布局)。所以我删除的删除,这是页面的顶​​部

I have a MVC 3 project in which I use _Layout.cshtml as master page in all web pages. Now I want to remove this master page (layout) from one of the page (progress.cshtml). So I removed the removed the top portion of the page which was

@{
ViewBag.Title = "Progress";
Layout = "~/Views/Shared/_Layout.cshtml";

}

我想这会工作,但是当我浏览网页的进展仍然显示从布局文件的内容。我怎样才能删除此绑定?

I thought this will work but when I browse progress page it still shows the content from layout file. How I can remove this binding?

推荐答案

设置布局= null来删除默认的布局继承该视图

Set the layout= null to remove the default layout inheritance in that view

这篇关于MVC 3剃须刀布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆