1、在母版页中指定子页面css和js布局

@RenderSection("Styles", false)
@RenderSection("Scripts", false)

说明:false表示子页面可以不理会此布局要求

2、子页面使用布局

@section Styles{ }   //括号中放置其他css的引用或自定义的<style> </style>标签
@section scripts{ }  // 括号中放置其他js的引用或自定义的<script></script> 标签

截图示例如下:

Styles

MVC在母版页设置子页面的css和js引用布局

scripts

MVC在母版页设置子页面的css和js引用布局

 

相关文章:

  • 2021-11-19
  • 2022-12-23
  • 2022-12-23
  • 2021-09-12
  • 2022-12-23
  • 2022-12-23
  • 2021-09-08
  • 2021-11-26
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-10-03
  • 2021-07-12
  • 2021-10-30
  • 2021-09-20
  • 2022-12-23
相关资源
相似解决方案