Layout = null;
在我看来,它怎么仍会保留默认布局呢?
有什么技巧可以阻止它这样做吗?
这是我没有布局的看法:
@{
Layout = "";
}
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
@{Html.RenderAction("Head", "Header");}
</head>
<body>
<div>
Home
</div>
</body>
</html>
这是渲染的输出!!
<!DOCTYPE html>
<html>
<head>
<title>Index</title>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<link href="/Content/Site.css" rel="stylesheet" type="text/css" />
<script src="/Scripts/jquery-1.5.1.min.js" type="text/javascript"></script>
<script src="/Scripts/modernizr-1.7.min.js" type="text/javascript"></script>
</head>
<body>
header
</body>
</html>
</head>
<body>
<div>
Home
</div>
</body>
</html>
null
在呈现的页面中看到单词了吗?