Web Pages

   一、布局

1.@RenderPage() 

在当前页面中插入某个页面

<html>
<body>
@RenderPage("header.cshtml")
<h1>Hello Web Pages</h1> 
<p>This is a paragraph</p>
@RenderPage("footer.cshtml")
</body>
</html>

2.@RenderBody()

定义模板

<html>
<body>
<p>This is header text</p>
@RenderBody()
<p>© xxxxxxx </p>
</body>
</html>

使用模板

@{Layout="Layout.cshtml";}

<h1>heiio</h1>

3@RenderSection()

 

二、路径

在asp.net core里

绝对路径

相对路径

三、

原文地址:https://www.cnblogs.com/buchizaodian/p/13091374.html