1、使用 @RenderPage() 方法从不同的文件导入内容。
2、除了index.cshtml页面里的内容,在浏览器查看index.cshtml时还会加载_Layout.cshtml里的内容。
使用方式:
(1)在_ViewStart.cshtml文件内选择要加载的页面,如图:
(2)_Layout.cshtml文件的设置:
1、使用 @RenderPage() 方法从不同的文件导入内容。
2、除了index.cshtml页面里的内容,在浏览器查看index.cshtml时还会加载_Layout.cshtml里的内容。
使用方式:
(1)在_ViewStart.cshtml文件内选择要加载的页面,如图:
(2)_Layout.cshtml文件的设置:
相关文章: