1、使用 @RenderPage() 方法从不同的文件导入内容。

ASP .Net学习笔记_20171115

2、除了index.cshtml页面里的内容,在浏览器查看index.cshtml时还会加载_Layout.cshtml里的内容。

ASP .Net学习笔记_20171115

使用方式:

(1)在_ViewStart.cshtml文件内选择要加载的页面,如图:

ASP .Net学习笔记_20171115

(2)_Layout.cshtml文件的设置:

ASP .Net学习笔记_20171115

相关文章:

  • 2021-07-11
  • 2021-08-30
  • 2022-01-09
  • 2021-09-07
  • 2021-04-11
  • 2021-08-12
  • 2021-12-11
  • 2021-06-17
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-07-08
  • 2022-12-23
  • 2022-01-27
  • 2021-12-20
相关资源
相似解决方案