在Razor中通过RenderPage调用头部和尾部文件即可实现header和footer文件的重复使用,类似include,但功能更强大
<html>
<body>
@RenderPage("header.cshtml")
<h1>Hello Web Pages</h1>
<p>This is a paragraph</p>
@RenderPage("footer.cshtml")
</body>
</html>
在Razor中通过RenderPage调用头部和尾部文件即可实现header和footer文件的重复使用,类似include,但功能更强大
<html>
<body>
@RenderPage("header.cshtml")
<h1>Hello Web Pages</h1>
<p>This is a paragraph</p>
@RenderPage("footer.cshtml")
</body>
</html>